Track PPP

This commit is contained in:
Marco van Dijk 2023-10-11 00:43:24 +02:00
parent 1533893e35
commit b6cbf3ea37

View File

@ -15,6 +15,12 @@ const promLatestLatency = new client.Gauge({
labelNames: ['region', 'orchestrator'] labelNames: ['region', 'orchestrator']
}); });
register.registerMetric(promLatestLatency); 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({ const promLatency = new client.Summary({
name: 'orch_latency', name: 'orch_latency',
help: 'Summary of latency stats', help: 'Summary of latency stats',
@ -122,6 +128,9 @@ masterRouter.post("/collectStats", async (req, res) => {
promLatestLatency.set({ region: tag, orchestrator: thisId }, responseTime); promLatestLatency.set({ region: tag, orchestrator: thisId }, responseTime);
promLatency.observe({ region: tag }, 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)"); console.log('received data for ' + thisId + ' from ' + tag + ' (' + responseTime + " ms latency)");
// Save data point // Save data point
const now = new Date().getTime(); const now = new Date().getTime();