Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 9905 - Investigate negative numbers on Summary's timeSinceLastAttempt field #10033

Merged
merged 3 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/runtime/container-runtime/src/runningSummarizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ export class RunningSummarizer implements IDisposable {
this.summaryCollection.unsetPendingAckTimerTimeoutCallback();

if (waitStartResult.result === "done" && waitStartResult.value !== undefined) {
this.heuristicData.initialize({
this.heuristicData.updateWithLastSummaryAckInfo({
refSequenceNumber: waitStartResult.value.summaryOp.referenceSequenceNumber,
summaryTime: waitStartResult.value.summaryOp.timestamp,
// This will be the Summarizer starting point so only use timestamps from client's machine.
summaryTime: Date.now(),
summarySequenceNumber: waitStartResult.value.summaryOp.sequenceNumber,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class SummarizeHeuristicData implements ISummarizeHeuristicData {
this._lastSuccessfulSummary = { ...attemptBaseline };
}

public initialize(lastSummary: Readonly<ISummarizeAttempt>) {
public updateWithLastSummaryAckInfo(lastSummary: Readonly<ISummarizeAttempt>) {
this._lastAttempt = lastSummary;
this._lastSuccessfulSummary = { ...lastSummary };
}
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/container-runtime/src/summarizerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ export interface ISummarizeHeuristicData {
readonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;

/**
* Initializes lastAttempt and lastSuccessfulAttempt based on the last summary.
* Updates lastAttempt and lastSuccessfulAttempt based on the last summary.
* @param lastSummary - last ack summary
*/
initialize(lastSummary: ISummarizeAttempt): void;
updateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;

/**
* Records a summary attempt. If the attempt was successfully sent,
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/container-runtime/src/summaryGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ export class SummaryGenerator {
const { refreshLatestAck, fullTree } = options;
const logger = ChildLogger.create(this.logger, undefined, { all: summarizeProps });

// Note: timeSinceLastAttempt and timeSinceLastSummary for the
// first summary are basically teh time since the summarizer was loaded.
NicholasCouri marked this conversation as resolved.
Show resolved Hide resolved
const timeSinceLastAttempt = Date.now() - this.heuristicData.lastAttempt.summaryTime;
const timeSinceLastSummary = Date.now() - this.heuristicData.lastSuccessfulSummary.summaryTime;
let summarizeTelemetryProps: SummaryGeneratorTelemetry = {
Expand Down