Skip to content

Commit

Permalink
[Port v2int 3.0] Rename TelemetryContext::SetAll to SetMultiple (#14873)
Browse files Browse the repository at this point in the history
Porting
fa58a17
to release/v2int/3.0 as this is a breaking change. runtime-utils version
2.0.0-internal.3.0 running with runtime-definitions version
2.0.0-internal.3.2+ will not work because this change went into
2.0.0-internal.3.2.

#14070 added a setAll
method to TelemetryContext that can be used to set mutliple values to
the telemety context. As per
#14153 (comment),
renaming the method to setMultiple since its more inline with what it
does.
  • Loading branch information
agarwal-navin authored Mar 30, 2023
1 parent 8456875 commit 8c4ab26
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api-report/runtime-definitions.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export interface ITelemetryContext {
get(prefix: string, property: string): TelemetryEventPropertyType;
serialize(): string;
set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
setAll(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
}

// @public
Expand Down
2 changes: 1 addition & 1 deletion api-report/runtime-utils.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class TelemetryContext implements ITelemetryContext {
// (undocumented)
set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
// (undocumented)
setAll(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
}

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>

const telemetryContext = new TelemetryContext();
// Add the options that are used to generate this summary to the telemetry context.
telemetryContext.setAll("fluid_Summarize", "Options", {
telemetryContext.setMultiple("fluid_Summarize", "Options", {
fullTree,
trackState,
runGC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ export class GarbageCollector implements IGarbageCollector {
}

// Add the options that are used to run GC to the telemetry context.
telemetryContext?.setAll("fluid_GC", "Options", { fullGC, runSweep: options.runSweep });
telemetryContext?.setMultiple("fluid_GC", "Options", { fullGC, runSweep: options.runSweep });

return PerformanceEvent.timedExecAsync(logger, { eventName: "GarbageCollection" }, async (event) => {
await this.runPreGCSteps();
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/runtime-definitions/src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export interface ITelemetryContext {
* @param property - property name of the telemetry data being tracked (ex: "Options")
* @param values - A set of values to attribute to this summary telemetry data.
*/
setAll(
setMultiple(
prefix: string,
property: string,
values: Record<string, TelemetryEventPropertyType>,
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/runtime-utils/src/summaryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ export class TelemetryContext implements ITelemetryContext {
}

/**
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setAll}
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setMultiple}
*/
setAll(
setMultiple(
prefix: string,
property: string,
values: Record<string, TelemetryEventPropertyType>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ describe("Summary Utils", () => {
telemetryContext.set("pre2_", "prop1", "10");
telemetryContext.set("pre2_", "prop2", true);
telemetryContext.set("pre1_", "prop2", undefined);
telemetryContext.setAll("pre3_", "obj1", { prop1: "1", prop2: 2, prop3: true });
telemetryContext.setMultiple("pre3_", "obj1", { prop1: "1", prop2: 2, prop3: true });

const serialized = telemetryContext.serialize();

Expand Down

0 comments on commit 8c4ab26

Please sign in to comment.