Skip to content
Snippets Groups Projects
Commit 28b99ce5 authored by Vincent Garonne's avatar Vincent Garonne
Browse files

Merge branch 'patch-1862-check_fts_backlog' into 'master'

[RUCIO-1862] Merge branch 'patch-1862-check_fts_backlog' of ssh://gitlab.cern.ch:7999/tkouba/rucio into patch-1862-check_fts_backlog

See merge request !456
parents c0ba9ca1 a38fefd1
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,6 @@ if __name__ == "__main__":
busy_channels = []
busylimit = 5000
for attempt in xrange(0, 5):
# print '%i/5 attempt to contact %s' % (attempt+1, ftshost)
try:
r = requests.get(url, verify=False)
res = r.json()
......@@ -55,15 +54,15 @@ if __name__ == "__main__":
src = channel['source_se']
dst = channel['dest_se']
if 'submitted' in channel and channel['submitted'] >= busylimit:
url_activities = '%s/fts3/ftsmon/config/activities/%s?source_se=%s&dest_se=%s' % (ftshost,vo,src,dst)
url_activities = '%s/fts3/ftsmon/config/activities/%s?source_se=%s&dest_se=%s' % (ftshost, vo, src, dst)
activities = {}
try:
s = requests.get(url_activities, verify=False)
for key,val in s.json().items():
for key, val in s.json().items():
activities[key] = val['SUBMITTED']
except Exception, e:
pass
busy_channels.append({'src':src, 'dst':dst, 'submitted':channel['submitted'], 'activities':activities})
pass
busy_channels.append({'src': src, 'dst': dst, 'submitted': channel['submitted'], 'activities': activities})
summary = res['summary']
h = urlparse(url)
hostname = h.hostname.replace('.', '_')
......@@ -71,10 +70,10 @@ if __name__ == "__main__":
print '%s : Active : %s' % (hostname, summary['active'])
print '%s : Staging : %s' % (hostname, summary['staging'])
print '%s : Started : %s' % (hostname, summary['started'])
if len(busy_channels)>0:
if len(busy_channels) > 0:
print 'Busy channels (>%s submitted):' % (busylimit)
for bc in busy_channels:
activities_str = ", ".join([("%s: %s" % (key,val)) for key,val in bc['activities'].items()])
activities_str = ", ".join([("%s: %s" % (key, val)) for key, val in bc['activities'].items()])
print ' %s to %s : %s submitted jobs (%s)' % (bc['src'], bc['dst'], bc['submitted'], str(activities_str))
monitor.record_gauge(stat='fts3.%s.submitted' % (hostname), value=(summary['submitted'] + summary['active'] + summary['staging'] + summary['started']))
retvalue = OK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment