Ori.livneh has submitted this change and it was merged. Change subject: Fix typo in profiler-to-carbon and tweak client behavior ......................................................................
Fix typo in profiler-to-carbon and tweak client behavior Change-Id: I6923ce665889ccd955b02e289c28277a21a87f1c --- M collector.c M profiler-to-carbon 2 files changed, 6 insertions(+), 11 deletions(-) Approvals: Ori.livneh: Verified; Looks good to me, approved diff --git a/collector.c b/collector.c index 2926192..f0dfa9b 100644 --- a/collector.c +++ b/collector.c @@ -38,7 +38,6 @@ ssize_t l; char buf[2000]; int r; - int n; /* Socket variables */ int s, exp; @@ -82,27 +81,23 @@ } /* Loop! loop! loop! */ for(;;) { - n=0; r=poll(fds,2,-1); /* Process incoming UDP queue */ while(( fds[0].revents & POLLIN ) && + !( fds[1].revents & POLLIN ) && ((l=recvfrom(s,&buf,1500,0,NULL,NULL))!=-1)) { if (l==EAGAIN) break; handleMessage((char *)&buf,l); - n++; - /* Still handle export connections under high load */ - if (n==5000) - break; } /* Process incoming TCP queue */ - while((fds[1].revents & POLLIN ) && - ((r=accept(exp,(struct sockaddr *)&them,&sl))!=-1)) { - if (r==EWOULDBLOCK) - break; + if (fds[1].revents & POLLIN) { + r = accept(exp, (struct sockaddr *)&them, &sl); + if ( r !=-1 && r != EAGAIN ) { handleConnection(r); + } } } return(0); diff --git a/profiler-to-carbon b/profiler-to-carbon index 8cd3f33..756b62c 100755 --- a/profiler-to-carbon +++ b/profiler-to-carbon @@ -130,7 +130,7 @@ while True: ep = ExtractProfile() try: - ep.extract(get_profiling_xml()) + fullprofile = ep.extract(get_profiling_xml()) except Exception: logging.exception('Failed to extract data from collector.') time.sleep(delay) -- To view, visit https://gerrit.wikimedia.org/r/101158 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6923ce665889ccd955b02e289c28277a21a87f1c Gerrit-PatchSet: 1 Gerrit-Project: operations/software/mwprof Gerrit-Branch: master Gerrit-Owner: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits