Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: metrics url for tds cluster is now correct
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines authored and mergify[bot] committed Jul 10, 2019
1 parent cb84f1b commit 5d52407
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/EndpointConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,30 @@ export function getApiWebsocketUrl() {

export function getMetricsDashboardUrl() {
let matches;

if (endpointName === 'local') {
matches = window.location.hostname.match('([^.]*).testnet.solana.com');
matches = window.location.hostname.match('(.*).solana.com');
} else {
const endpointUrl = urlMap[endpointName];
matches = endpointUrl.match('/([^.]*).testnet.solana.com');
matches = endpointUrl.match('/([^/]*).solana.com');
}

let url =
'https://metrics.solana.com:3000/d/testnet-beta/testnet-monitor-beta?refresh=5s&from=now-5m&to=now';
if (matches) {
const testnet = matches[1];
url += `&var-testnet=testnet-${testnet}`;
const metricsDbMap = {
'edge.testnet': 'testnet-edge',
'beta.testnet': 'testnet-beta',
'testnet': 'testnet',
'tds': 'testnet-tds',
};
console.log('getMetricsDashboardUrl matches:', matches);

const testnet = metricsDbMap[matches[1]];
console.log('getMetricsDashboardUrl testnet:', testnet);
if (testnet) {
url += `&var-testnet=${testnet}`;
}
}
console.log('getMetricsDashboardUrl:', url);
return url;
Expand Down

0 comments on commit 5d52407

Please sign in to comment.