mirror of https://github.com/grpc/grpc-node.git
Send buffered stats when starting LRS stream
This commit is contained in:
parent
338941d664
commit
60bc11285b
|
|
@ -1029,7 +1029,6 @@ export class XdsClient {
|
|||
message.load_reporting_interval!.nanos / 1_000_000;
|
||||
trace('Received LRS request with load reporting interval ' + loadReportingIntervalMs + ' ms');
|
||||
this.statsTimer = setInterval(() => {
|
||||
trace('Sending LRS stats');
|
||||
this.sendStats();
|
||||
}, loadReportingIntervalMs);
|
||||
}
|
||||
|
|
@ -1047,15 +1046,16 @@ export class XdsClient {
|
|||
this.maybeStartLrsStream();
|
||||
}
|
||||
});
|
||||
this.lrsCall.write({
|
||||
node: this.lrsNode!,
|
||||
});
|
||||
/* Send buffered stats information when starting LRS stream. If there is no
|
||||
* buffered stats information, it will still send the node field. */
|
||||
this.sendStats();
|
||||
}
|
||||
|
||||
private sendStats() {
|
||||
if (!this.lrsCall) {
|
||||
return;
|
||||
}
|
||||
trace('Sending LRS stats');
|
||||
const clusterStats: ClusterStats[] = [];
|
||||
for (const [
|
||||
{ clusterName, edsServiceName },
|
||||
|
|
|
|||
Loading…
Reference in New Issue