Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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