Created
November 4, 2016 14:00
-
-
Save emileaben/496c1994ff75c9fb90445b4dd57b1f9d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import sys | |
## usage | |
## ./create-latencymon.py <prb> <msm>,<msm>,<msm>,<msm> > index.html | |
## then load html in a browser | |
prb_str = sys.argv[1] | |
prb_list = prb_str.split(',') | |
msm_str = sys.argv[2] | |
msm_list = msm_str.split(',') | |
print ''' | |
<script src="https://atlas.ripe.net/resource/latencymon/latencymon-widget-main.js"></script> | |
<div id="place-here"></div> | |
<script> | |
initLatencymon( | |
'#place-here', | |
{}, // Tool options, see table below for more info | |
{ | |
''' | |
print "measurements:[%s]," % ( msm_str ) | |
print "groups: [", | |
group_str = [] | |
for msm_id in msm_list: | |
group_str.append( "{measurementId: %s, probes: [%s], id: %s, type: 'multi-probes'}" % ( msm_id, prb_str, msm_id ) ) | |
print ",".join(group_str) , | |
print "] } ) // Query options, see table below for more info" | |
print "</script>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment