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

Commit

Permalink
fix: correctly set metrics database for current endpoint
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 2c5379e commit d4aa05d
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/EndpointConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,15 @@ export function getApiWebsocketUrl() {
}

export function getMetricsDashboardUrl() {
let matches;

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

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

0 comments on commit d4aa05d

Please sign in to comment.