mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 10:55:09 +02:00
Track PPP
This commit is contained in:
parent
1533893e35
commit
b6cbf3ea37
@ -15,6 +15,12 @@ const promLatestLatency = new client.Gauge({
|
||||
labelNames: ['region', 'orchestrator']
|
||||
});
|
||||
register.registerMetric(promLatestLatency);
|
||||
const promLatestPPP = new client.Gauge({
|
||||
name: 'orch_latest_ppp',
|
||||
help: 'Latest price per pixel known for a given Orchestrator',
|
||||
labelNames: ['region', 'orchestrator']
|
||||
});
|
||||
register.registerMetric(promLatestPPP);
|
||||
const promLatency = new client.Summary({
|
||||
name: 'orch_latency',
|
||||
help: 'Summary of latency stats',
|
||||
@ -122,6 +128,9 @@ masterRouter.post("/collectStats", async (req, res) => {
|
||||
promLatestLatency.set({ region: tag, orchestrator: thisId }, responseTime);
|
||||
promLatency.observe({ region: tag }, responseTime);
|
||||
}
|
||||
if (discoveryResults && discoveryResults.price_info){
|
||||
promLatestPPP.set({ region: tag, orchestrator: thisId }, discoveryResults.price_info.pricePerUnit / discoveryResults.price_info.pixelsPerUnit);
|
||||
}
|
||||
console.log('received data for ' + thisId + ' from ' + tag + ' (' + responseTime + " ms latency)");
|
||||
// Save data point
|
||||
const now = new Date().getTime();
|
||||
|
Loading…
x
Reference in New Issue
Block a user