-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Xds Server metric provider (#997)
* add indis observer latency metric provider * rename the interface for OSS * track latency for d2 node type resource as well * track latency only for non-initial update * deprecate old constructor and fix some styles * add more latency metrics and address comments * update version in gradle.properties * cleanup
- Loading branch information
Showing
14 changed files
with
420 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
d2/src/main/java/com/linkedin/d2/jmx/NoOpXdsServerMetricsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.linkedin.d2.jmx; | ||
|
||
|
||
/** | ||
* NoOp implementation of {@link XdsServerMetricsProvider} | ||
*/ | ||
public class NoOpXdsServerMetricsProvider implements XdsServerMetricsProvider { | ||
@Override | ||
public long getLatencyMin() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public double getLatencyAverage() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLatency50Pct() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLatency99Pct() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLatency99_9Pct() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getLatencyMax() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void trackLatency(long latency) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
d2/src/main/java/com/linkedin/d2/jmx/XdsServerMetricsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.linkedin.d2.jmx; | ||
|
||
|
||
/** | ||
* Interface for providing metrics for Xds Server | ||
*/ | ||
public interface XdsServerMetricsProvider { | ||
/** | ||
* Get minimum of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
long getLatencyMin(); | ||
|
||
/** | ||
* Get Avg of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
double getLatencyAverage(); | ||
|
||
/** | ||
* Get 50 Percentile of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
long getLatency50Pct(); | ||
|
||
/** | ||
* Get 90 Percentile of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
long getLatency99Pct(); | ||
|
||
/** | ||
* Get 99.9 Percentile of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
long getLatency99_9Pct(); | ||
|
||
/** | ||
* Get maximum of Xds server latency, which is from when the resource is updated on the Xds server to when the | ||
* client receives it. | ||
*/ | ||
long getLatencyMax(); | ||
|
||
/** | ||
* Track the latency of the Xds server. | ||
* @param latency the latency to track | ||
*/ | ||
void trackLatency(long latency); | ||
} |
Oops, something went wrong.