ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TMonaLisaWriter.cxx
Go to the documentation of this file.
1 // @(#)root/monalisa:$Id$
2 // Author: Andreas Peters 5/10/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TMonaLisaWriter //
15 // //
16 // Class defining interface to MonaLisa Monitoring Services in ROOT. //
17 // The TMonaLisaWriter object is used to send monitoring information to //
18 // a MonaLisa server using the ML ApMon package (libapmoncpp.so/UDP //
19 // packets). The MonaLisa ApMon library for C++ can be downloaded at //
20 // http://monalisa.cacr.caltech.edu/monalisa__Download__ApMon.html, //
21 // current version: //
22 // http://monalisa.cacr.caltech.edu/download/apmon/ApMon_c-2.2.0.tar.gz //
23 // //
24 // The ROOT implementation is primary optimized for process/job //
25 // monitoring, although all other generic MonaLisa ApMon functionality //
26 // can be exploited through the ApMon class directly via //
27 // dynamic_cast<TMonaLisaWriter*>(gMonitoringWriter)->GetApMon(). //
28 // //
29 // Additions/modifications by Fabrizio Furano 10/04/2008 //
30 // - The implementation of TFile throughput and info sending was //
31 // just sending 'regular' samples about the activity of the single TFile//
32 // instance that happened to trigger an activity in the right moment. //
33 // - Now TMonaLisaWriter keeps internally track of every activity //
34 // and regularly sends summaries valid for all the files which had //
35 // activity in the last time interval. //
36 // - Additionally, it's now finalized the infrastructure able to measure//
37 // and keep track of the file Open latency. A packet is sent for each //
38 // successful Open, sending the measures of the latencies for the //
39 // various phases of the open. Currently exploited fully by TAlienFile //
40 // and TXNetFile. Easy to report from other TFiles too. //
41 // - Now, the hook for the Close() func triggers sending of a packet //
42 // containing various information about the performance related to that //
43 // file only. //
44 // - Added support also for performance monitoring when writing //
45 //////////////////////////////////////////////////////////////////////////
46 
47 #include <cmath>
48 #include "TMonaLisaWriter.h"
49 #include "TSystem.h"
50 #include "TGrid.h"
51 #include "TFile.h"
52 #include "TUrl.h"
53 #include "TStopwatch.h"
54 #include "Riostream.h"
55 #include "TParameter.h"
56 #include "THashList.h"
57 
58 
60 
61 
62 // Information which is kept about an alive instance of TFile
63 class MonitoredTFileInfo: public TObject {
64 private:
65  TFile *fileinst;
66 public:
67  MonitoredTFileInfo(TFile *file, Double_t timenow): TObject(), fileinst(file) {
68  if (file->InheritsFrom("TXNetFile"))
69  fFileClassName = "TXNetFile";
70  else
71  fFileClassName = file->ClassName();
72 
73  fLastBytesRead = 0;
75 
76  fTempReadBytes = 0;
78 
79  fLastResetTime = timenow;
80  fCreationTime = timenow;
81 
82  fKillme = kFALSE;
83  }
84 
86 
88 
93 
95 
96  Bool_t fKillme; // tells to remove the instance after the next computation step
97 
98  void GetThroughputs(Long64_t &readthr, Long64_t &writethr, Double_t timenow, Double_t prectime) {
99  readthr = -1;
100  writethr = -1;
101  Double_t t = std::min(prectime, fLastResetTime);
102 
103  Int_t mselapsed = std::round(std::floor(((timenow - t) * 1000)));
104  mselapsed = std::max(mselapsed, 1);
105 
106  readthr = fTempReadBytes / mselapsed * 1000;
107  writethr = fTempWrittenBytes / mselapsed * 1000;
108  }
109 
111  fTempReadBytes = file->GetBytesRead() - fLastBytesRead;
112  fTempWrittenBytes = file->GetBytesWritten() - fLastBytesWritten;
113  }
114 
115  void ResetFileStatus(TFile *file, Double_t timenow) {
116  if (fKillme) return;
117  fLastBytesRead = file->GetBytesRead();
118  fLastBytesWritten = file->GetBytesWritten();
119  fTempReadBytes = 0;
120  fTempWrittenBytes = 0;
121  fLastResetTime = timenow;
122  }
123 
124  void ResetFileStatus(Double_t timenow) {
125  if (fKillme) return;
126  ResetFileStatus(fileinst, timenow);
127  }
128 
129 };
130 
131 
132 
133 
134 // Helper used to build up ongoing throughput summaries
135 class MonitoredTFileSummary: public TNamed {
136 public:
137  MonitoredTFileSummary(TString &fileclassname): TNamed(fileclassname, fileclassname) {
138  fBytesRead = 0;
139  fBytesWritten = 0;
140  fReadThroughput = 0;
141  fWriteThroughput = 0;
142  }
143 
144  Long64_t fBytesRead;
145  Long64_t fBytesWritten;
146  Long64_t fReadThroughput;
147  Long64_t fWriteThroughput;
148 
149  void Update(MonitoredTFileInfo *mi, Double_t timenow, Double_t prectime) {
150  Long64_t rth, wth;
151  mi->GetThroughputs(rth, wth, timenow, prectime);
152 
153  fBytesRead += mi->fTempReadBytes;
154  fBytesWritten += mi->fTempWrittenBytes;
155 
156  if (rth > 0) fReadThroughput += rth;
157  if (wth > 0) fWriteThroughput += wth;
158  }
159 
160 };
161 
162 
163 
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Create MonaLisa write object.
166 
167 TMonaLisaWriter::TMonaLisaWriter(const char *monserver, const char *montag,
168  const char *monid, const char *monsubid,
169  const char *option)
170 {
171  fMonInfoRepo = new std::map<UInt_t, MonitoredTFileInfo *>;
172 
173  Init(monserver, montag, monid, monsubid, option);
174 }
175 
176 ////////////////////////////////////////////////////////////////////////////////
177 /// Creates a TMonaLisaWriter object to send monitoring information to a
178 /// MonaLisa server using the MonaLisa ApMon package (libapmoncpp.so/UDP
179 /// packets). The MonaLisa ApMon library for C++ can be downloaded at
180 /// http://monalisa.cacr.caltech.edu/monalisa__Download__ApMon.html,
181 /// current version:
182 /// http://monalisa.cacr.caltech.edu/download/apmon/ApMon_cpp-2.0.6.tar.gz
183 ///
184 /// The ROOT implementation is primary optimized for process/job monitoring,
185 /// although all other generic MonaLisa ApMon functionality can be exploited
186 /// through the ApMon class directly (gMonitoringWriter->GetApMon()).
187 ///
188 /// Monitoring information in MonaLisa is structured in the following tree
189 /// structure:
190 /// <farmname>
191 /// |
192 /// ---> <nodename1>
193 /// |
194 /// ---> <key1> - <value1>
195 /// ---> <key2> - <value2>
196 /// ---> <nodename2>
197 /// |
198 /// ---> <key3> - <value3>
199 /// ---> <key4> - <value4>
200 ///
201 /// The parameter monid is equivalent to the MonaLisa node name, for the
202 /// case of process monitoring it can be just an identifier to classify
203 /// the type of jobs e.g. "PROOF_PROCESSING".
204 /// If monid is not specified, TMonaLisaWriter tries to set it in this order
205 /// from environment variables:
206 /// - PROOF_JOB_ID
207 /// - GRID_JOB_ID
208 /// - LCG_JOB_ID
209 /// - ALIEN_MASTERJOB_ID
210 /// - ALIEN_PROC_ID
211 ///
212 /// The parameter montag is equivalent to the MonaLisa farm name, for the
213 /// case of process monitoring it can be a process identifier e.g. a PROOF
214 /// session ID.
215 ///
216 /// The parameter monserver specifies the server to whom to send the
217 /// monitoring UDP packets. If not specified, the hostname (the port is
218 /// a default one) is specified in the environment variable APMON_CONFIG.
219 ///
220 /// To use TMonaLisaWriter, libMonaLisa.so has to be loaded.
221 ///
222 /// According to the fact, that the deepness of the MonaLisa naming scheme
223 /// is only 3 (<farm><node><value>), a special naming scheme is used for
224 /// process monitoring. There is a high-level method to send progress
225 /// information of Tree analysis (# of events, datasize).
226 /// To distinguish individual nodes running the processing, part of the
227 /// information is kept in the <value> parameter of ML.
228 /// <value> is named as:
229 /// <site-name>:<host-name>:<pid>:<valuetag>
230 /// <site-name> is taken from an environment variable in the following order:
231 /// - PROOF_SITE
232 /// - GRID_SITE
233 /// - ALIEN_SITE
234 /// - default 'none'
235 /// <host-name> is taken from gSystem->Hostname()
236 /// <pid> is the process ID of the ROOT process
237 ///
238 /// Example of use for Process Monitoring:
239 /// new TMonaLisaWriter("BATCH_ANALYSIS","AnalysisLoop-00001","lxplus050.cern.ch");
240 /// Once when you create an analysis task, execute
241 /// gMonitoringWriter->SendInfoUser("myname");
242 /// gMonitoringWriter->SendInfoDescription("My first Higgs analysis");
243 /// gMonitoringWriter->SendInfoTime();
244 /// gMonitoringWriter->SendInfoStatus("Submitted");
245 ///
246 /// On each node executing a subtask, you can set the status of this subtask:
247 /// gMonitoringWriter->SendProcessingStatus("Started");
248 /// During the processing of your analysis you can send progress updates:
249 /// gMonitoringWriter->SendProcessProgress(100,1000000); <= 100 events, 1MB processed
250 /// ....
251 /// gMonitoringWriter-SendProcessingStatus("Finished");
252 /// delete gMonitoringWriter; gMonitoringWriter=0;
253 ///
254 /// Example of use for any Generic Monitoring information:
255 /// TList *valuelist = new TList();
256 /// valuelist->SetOwner(kTRUE);
257 /// // append a text object
258 /// TMonaLisaText *valtext = new TMonaLisaText("decaychannel","K->eeg");
259 /// valuelist->Add(valtext);
260 /// // append a double value
261 /// TMonaLisaValue* valdouble = new TMonaLisaValue("n-gamma",5);
262 /// valuelist->Add(valdouble);
263 /// Bool_t success = SendParameters(valuelist);
264 /// delete valuelist;
265 ///
266 /// option:
267 /// "global": gMonitoringWriter is initialized with this instance
268 
269 void TMonaLisaWriter::Init(const char *monserver, const char *montag, const char *monid,
270  const char *monsubid, const char *option)
271 {
272  SetName(montag);
273  SetTitle(montag);
274 
275  fVerbose = kFALSE; // no verbosity as default
276 
280  fLastProgressTime = time(0);
282 
283  fReportInterval = 120; // default interval is 120, to prevent flooding
284  if (gSystem->Getenv("APMON_INTERVAL")) {
285  fReportInterval = atoi(gSystem->Getenv("APMON_INTERVAL"));
286  if (fReportInterval < 1)
287  fReportInterval =1;
288  Info("TMonaLisaWriter","Setting APMON Report Interval to %d seconds",fReportInterval);
289  }
290 
291  char *apmon_config[1] =
292  { ((monserver == 0) ? (char *) gSystem->Getenv("APMON_CONFIG") : (char *) monserver) };
293  if (apmon_config[0] == 0) {
294  Error("TMonaLisaWriter",
295  "Disabling apmon monitoring since env variable APMON_CONFIG was not found and the monitoring server is not specified in the constructor!");
297  return;
298  }
299 
300  try {
301  fApmon = new ApMon(1, apmon_config);
302  fApmon->setConfRecheck(false);
303  fApmon->setJobMonitoring(false);
304  //((ApMon*)fApmon)->setSysMonitoring(false);
305  //((ApMon*)fApmon)->setGenMonitoring(false);
306  } catch (runtime_error &e) {
307  Error("TMonaLisaWriter", "Error initializing ApMon: %s", e.what());
308  Error("TMonaLisaWriter", "Disabling apmon.");
310  return;
311  }
312 
313  TString clustername="ROOT_";
314 
315  if (montag == 0) {
316  if (gSystem->Getenv("PROOF_SITE")) {
317  clustername+=(gSystem->Getenv("PROOF_SITE"));
318  } else if (gSystem->Getenv("GRID_SITE")) {
319  clustername+=(gSystem->Getenv("GRID_SITE"));
320  } else if (gSystem->Getenv("LCG_SITE")) {
321  clustername+=(gSystem->Getenv("LCG_SITE"));
322  } else if (gSystem->Getenv("ALIEN_SITE")) {
323  clustername+=(gSystem->Getenv("ALIEN_SITE"));
324  } else {
325  clustername += TString("none");
326  }
327  SetName(clustername);
328  SetTitle(clustername);
329  } else {
330  SetName(clustername+TString(montag));
331  SetTitle(clustername+TString(montag));
332  }
333 
335  fPid = gSystem->GetPid();
336 
337  if (monid == 0) {
338  if (gSystem->Getenv("PROOF_QUERY_ID"))
339  fJobId = gSystem->Getenv("PROOF_QUERY_ID");
340  else if (gSystem->Getenv("GRID_JOB_ID"))
341  fJobId = gSystem->Getenv("GRID_JOB_ID");
342  else if (gSystem->Getenv("LCG_JOB_ID"))
343  fJobId = gSystem->Getenv("LCG_JOB_ID");
344  else if (gSystem->Getenv("ALIEN_MASTERJOBID"))
345  fJobId = gSystem->Getenv("ALIEN_MASTERJOBID");
346  else if (gSystem->Getenv("ALIEN_PROC_ID"))
347  fJobId = gSystem->Getenv("ALIEN_PROC_ID");
348  else
349  fJobId = "-no-job-id";
350  } else {
351  fJobId = monid;
352  }
353 
354  if (monsubid == 0) {
355  if (gSystem->Getenv("PROOF_PROC_ID")) {
356  fSubJobId = gSystem->Getenv("PROOF_PROC_ID");
357  } else if (gSystem->Getenv("ALIEN_PROC_ID")) {
358  fSubJobId = gSystem->Getenv("ALIEN_PROC_ID");
359  } else {
360  fSubJobId = fJobId;
361  }
362  } else {
363  fSubJobId = monsubid;
364  }
365 
366 
367  if (fVerbose)
368  Info("Initialized for ML Server <%s> - Setting ClusterID <%s> JobID <%s> SubID <%s>\n",
369  apmon_config[0], fName.Data() ,fJobId.Data(),fSubJobId.Data());
370 
372 
373  TString optionStr(option);
374  if (optionStr.Contains("global"))
375  gMonitoringWriter = this;
376 }
377 
378 ////////////////////////////////////////////////////////////////////////////////
379 /// Cleanup.
380 
382 {
383  if (fMonInfoRepo) {
384 
385  std::map<UInt_t, MonitoredTFileInfo *>::iterator iter = fMonInfoRepo->begin();
386  while (iter != fMonInfoRepo->end()) {
387  delete iter->second;
388  iter++;
389  }
390 
391  fMonInfoRepo->clear();
392  delete fMonInfoRepo;
393  fMonInfoRepo = 0;
394  }
395 
396  if (gMonitoringWriter == this)
397  gMonitoringWriter = 0;
398 }
399 
400 ////////////////////////////////////////////////////////////////////////////////
401 /// Sends a <status> text to MonaLisa following the process scheme:
402 /// <site> --> <jobid> --> 'status' = <status>
403 /// Used to set a global status for a groupjob, e.g.
404 /// a master-job or the general status of PROOF processing.
405 
407 {
408  if (!fInitialized) {
409  Error("SendInfoStatus", "Monitoring is not properly initialized!");
410  return kFALSE;
411  }
412 
413  Bool_t success = kFALSE;
414 
415  TList *valuelist = new TList();
416  valuelist->SetOwner(kTRUE);
417 
418  // create a monitor text object
419  TMonaLisaText *valtext = new TMonaLisaText("status", status);
420  valuelist->Add(valtext);
421 
422  // send it to monalisa
423  success = SendParameters(valuelist);
424 
425  delete valuelist;
426  return success;
427 }
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 /// Sends the <user> text to MonaLisa following the process scheme:
431 /// <site> --> <jobid> --> 'user' = <user>
432 
434 {
435  if (!fInitialized) {
436  Error("TMonaLisaWriter",
437  "Monitoring initialization has failed - you can't send to MonaLisa!");
438  return kFALSE;
439  }
440 
441  Bool_t success = kFALSE;
442 
443  TList *valuelist = new TList();
444  valuelist->SetOwner(kTRUE);
445 
446  const char *localuser;
447  if (user) {
448  localuser = user;
449  } else {
450  if (gGrid) {
451  localuser = gGrid->GetUser();
452  } else {
453  localuser = "unknown";
454  }
455  }
456 
457  // create a monitor text object
458  TMonaLisaText *valtext = new TMonaLisaText("user", localuser);
459  valuelist->Add(valtext);
460 
461  // send it to monalisa
462  success = SendParameters(valuelist);
463 
464  delete valuelist;
465  return success;
466 }
467 
468 ////////////////////////////////////////////////////////////////////////////////
469 /// Sends the description <jobtag> following the processing scheme:
470 /// <site> --> <jobid> --> 'jobname' = <jobtag>
471 
473 {
474  if (!fInitialized) {
475  Error("SendInfoDescription",
476  "Monitoring is not properly initialized!");
477  return kFALSE;
478  }
479 
480  Bool_t success = kFALSE;
481 
482  TList *valuelist = new TList();
483  valuelist->SetOwner(kTRUE);
484 
485  // create a monitor text object
486  TMonaLisaText *valtext = new TMonaLisaText("jobname", jobtag);
487  valuelist->Add(valtext);
488 
489  // send it to monalisag
490  success = SendParameters(valuelist);
491 
492  delete valuelist;
493  return success;
494 }
495 
496 ////////////////////////////////////////////////////////////////////////////////
497 /// Sends the current time to MonaLisa following the processing scheme
498 /// <site> --> <jobid> --> 'time' = >unixtimestamp<
499 
501 {
502  if (!fInitialized) {
503  Error("SendInfoTime", "Monitoring is not properly initialized!");
504  return kFALSE;
505  }
506 
507  Bool_t success = kFALSE;
508 
509  TList *valuelist = new TList();
510  valuelist->SetOwner(kTRUE);
511 
512  TString valtime = (Int_t) time(0);
513 
514  // create a monitor text object
515  TMonaLisaText *valtext = new TMonaLisaText("time", valtime);
516  valuelist->Add(valtext);
517 
518  // send it to monalisa
519  success = SendParameters(valuelist);
520 
521  delete valuelist;
522  return success;
523 }
524 
525 ////////////////////////////////////////////////////////////////////////////////
526 /// Send the procesing status 'status' to MonaLisa following the
527 /// processing scheme:
528 /// <site> --> <jobid> --> 'status' = <status>
529 /// Used, to set the processing status of individual subtaks e.g. the
530 /// status of a batch (sub-)job or the status of a PROOF slave
531 /// participating in query <jobid>
532 
534 {
535  if (restarttimer) {
537  }
538 
539  if (!fInitialized) {
540  Error("TMonaLisaWriter",
541  "Monitoring initialization has failed - you can't send to MonaLisa!");
542  return kFALSE;
543  }
544 
545  Bool_t success = kFALSE;
546 
547  TList *valuelist = new TList();
548  valuelist->SetOwner(kTRUE);
549 
550  // create a monitor text object
551  TMonaLisaText *valtext = new TMonaLisaText("status", status);
552  valuelist->Add(valtext);
553 
554  TMonaLisaText *valhost = new TMonaLisaText("hostname",fHostname);
555  valuelist->Add(valhost);
556 
557  TMonaLisaText *valsid = new TMonaLisaText("subid", fSubJobId.Data());
558  valuelist->Add(valsid);
559 
560  // send it to monalisa
561  success = SendParameters(valuelist);
562 
563  delete valuelist;
564  return success;
565 }
566 
567 ////////////////////////////////////////////////////////////////////////////////
568 /// Send the procesing progress to MonaLisa.
569 
571 {
572  if (!force && (time(0)-fLastProgressTime) < fReportInterval) {
573  // if the progress is not forced, we send maximum < fReportInterval per second!
574  return kFALSE;
575  }
576 
577  if (!fInitialized) {
578  Error("SendProcessingProgress",
579  "Monitoring is not properly initialized!");
580  return kFALSE;
581  }
582 
583  Bool_t success = kFALSE;
584 
585  TList *valuelist = new TList();
586  valuelist->SetOwner(kTRUE);
587 
588  // create a monitor text object
589  TMonaLisaValue *valevent = new TMonaLisaValue("events", nevent);
590  TMonaLisaValue *valbyte = new TMonaLisaValue("processedbytes", nbytes);
591  TMonaLisaValue *valrealtime = new TMonaLisaValue("realtime",fStopwatch.RealTime());
592  TMonaLisaValue *valcputime = new TMonaLisaValue("cputime",fStopwatch.CpuTime());
593 
594  ProcInfo_t pinfo;
595  gSystem->GetProcInfo(&pinfo);
596  Double_t totmem = (Double_t)(pinfo.fMemVirtual) * 1024.;
597  Double_t rssmem = (Double_t)(pinfo.fMemResident) * 1024.;
598  Double_t shdmem = 0.;
599 
600  TMonaLisaValue *valtotmem = new TMonaLisaValue("totmem",totmem);
601  TMonaLisaValue *valrssmem = new TMonaLisaValue("rssmem",rssmem);
602  TMonaLisaValue *valshdmem = new TMonaLisaValue("shdmem",shdmem);
603 
604  TMonaLisaText *valsid = new TMonaLisaText("subid", fSubJobId.Data());
605  valuelist->Add(valsid);
606  valuelist->Add(valevent);
607  valuelist->Add(valbyte);
608  valuelist->Add(valrealtime);
609  valuelist->Add(valcputime);
610  valuelist->Add(valtotmem);
611  valuelist->Add(valrssmem);
612  valuelist->Add(valshdmem);
613 
614  TString strevents="";
615  strevents += nevent;
616  TString strbytes="";
617  strbytes += nbytes;
618  TString strcpu="";
619  strcpu += fStopwatch.CpuTime();
620  TString strreal="";
621  strreal += fStopwatch.RealTime();
622  TString strtotmem="";
623  strtotmem += totmem;
624  TString strrssmem="";
625  strrssmem += rssmem;
626  TString strshdmem="";
627  strshdmem += shdmem;
628 
630 
631  TMonaLisaText *textevent = new TMonaLisaText("events_str", strevents.Data());
632  TMonaLisaText *textbyte = new TMonaLisaText("processedbytes_str", strbytes.Data());
633  TMonaLisaText *textreal = new TMonaLisaText("realtime_str", strreal.Data());
634  TMonaLisaText *textcpu = new TMonaLisaText("cputime_str", strcpu.Data());
635  TMonaLisaText *texttotmem = new TMonaLisaText("totmem_str", strtotmem.Data());
636  TMonaLisaText *textrssmem = new TMonaLisaText("rssmem_str", strrssmem.Data());
637  TMonaLisaText *textshdmem = new TMonaLisaText("shdmem_str", strshdmem.Data());
638  valuelist->Add(textevent);
639  valuelist->Add(textbyte);
640  valuelist->Add(textcpu);
641  valuelist->Add(textreal);
642  valuelist->Add(texttotmem);
643  valuelist->Add(textrssmem);
644  valuelist->Add(textshdmem);
645 
646  TMonaLisaText *valhost = new TMonaLisaText("hostname",fHostname);
647  valuelist->Add(valhost);
648 
649  // send it to monalisa
650  success = SendParameters(valuelist);
651  fLastProgressTime = time(0);
652  delete valuelist;
653  return success;
654 }
655 
656 ////////////////////////////////////////////////////////////////////////////////
657 /// Send the fileopen progress to MonaLisa.
658 /// If openphases=0 it means that the information is to be stored
659 /// in a temp space, since there is not yet an object where to attach it to.
660 /// This is typical in the static Open calls.
661 /// The temp openphases are put into a list as soon as one is specified.
662 ///
663 /// If thisopenphasename=0 it means that the stored phases (temp and object)
664 /// have to be cleared.
665 
667  const char *openphasename,
668  Bool_t forcesend)
669 {
670  if (!fInitialized) {
671  Error("SendFileOpenProgress",
672  "Monitoring is not properly initialized!");
673  return kFALSE;
674  }
675 
676  // Create the list, if not yet done
677  if (!fTmpOpenPhases && !openphases) {
678  fTmpOpenPhases = new TList;
680  }
681 
682  if (!openphasename) {
683  // This means "reset my phases"
685  return kTRUE;
686  }
687 
688  // Take a measurement
691 
692  if (!openphases) {
693  fTmpOpenPhases->Add(nfo);
694  } else {
695  // Move info temporarly saved to object list
696  TIter nxt(fTmpOpenPhases);
697  TParameter<Double_t> *nf = 0;
698  while ((nf = (TParameter<Double_t> *)nxt()))
699  openphases->Add(nf);
700  // Add this measurement
701  openphases->Add(nfo);
702  // Reset the temporary list
703  if (fTmpOpenPhases) {
706  }
707 
708  }
709 
710  if (!forcesend) return kTRUE;
711  if (!file) return kTRUE;
712 
713  TList *op = openphases ? openphases : fTmpOpenPhases;
714 
715  Bool_t success = kFALSE;
716 
717 
718  TList *valuelist = new TList();
719  valuelist->SetOwner(kTRUE);
720 
721  // create a monitor text object
722 
723  TMonaLisaText *valhost = new TMonaLisaText("hostname",fHostname);
724  valuelist->Add(valhost);
725  TMonaLisaText *valsid = new TMonaLisaText("subid", fSubJobId.Data());
726  valuelist->Add(valsid);
727  TMonaLisaText *valdest = new TMonaLisaText("destname", file->GetEndpointUrl()->GetHost());
728  valuelist->Add(valdest);
729 
730  TMonaLisaValue *valfid = new TMonaLisaValue("fileid", file->GetFileCounter());
731  valuelist->Add(valfid);
732  TString strfid = Form("%lld", file->GetFileCounter());
733  TMonaLisaText *valstrfid = new TMonaLisaText("fileid_str", strfid.Data());
734  valuelist->Add(valstrfid);
735 
736  Int_t kk = 1;
737  TIter nxt(op);
738  TParameter<Double_t> *nf1 = 0;
740  while ((nf1 = (TParameter<Double_t> *)nxt())) {
741  TString s = Form("openphase%d_%s", kk, nf0->GetName());
742  TMonaLisaValue *v = new TMonaLisaValue(s.Data(), nf1->GetVal() - nf0->GetVal());
743  valuelist->Add(v);
744  // Go to next
745  nf0 = nf1;
746  kk++;
747  }
748 
749  // Now send how much time was elapsed in total
750  nf0 = (TParameter<Double_t> *)op->First();
751  nf1 = (TParameter<Double_t> *)op->Last();
752  TMonaLisaValue *valtottime =
753  new TMonaLisaValue("total_open_time", nf1->GetVal() - nf0->GetVal());
754  valuelist->Add(valtottime);
755 
756  // send it to monalisa
757  success = SendParameters(valuelist);
758  delete valuelist;
759  return success;
760 }
761 
762 ////////////////////////////////////////////////////////////////////////////////
763 
765  if (!fInitialized) {
766  Error("SendFileCloseEvent",
767  "Monitoring is not properly initialized!");
768  return kFALSE;
769  }
770 
771  Bool_t success = kFALSE;
772  Double_t timenow = fFileStopwatch.RealTime();
774 
775  MonitoredTFileInfo *mi = 0;
776  std::map<UInt_t, MonitoredTFileInfo *>::iterator iter = fMonInfoRepo->find(file->GetUniqueID());
777  if (iter != fMonInfoRepo->end()) mi = iter->second;
778 
779  Double_t timelapsed = 0.0;
780  if (mi) timelapsed = timenow - mi->fCreationTime;
781 
782  TList *valuelist = new TList();
783  valuelist->SetOwner(kTRUE);
784 
785  TString valname;
786  TString pfx = file->ClassName();
787  if (file->InheritsFrom("TXNetFile"))
788  pfx = "TXNetFile";
789 
790  pfx += "_";
791 
792  // The info to be sent is the one relative to the specific file
793 
794  TMonaLisaText *valdest = new TMonaLisaText("destname",file->GetEndpointUrl()->GetHost());
795  valuelist->Add(valdest);
796  TMonaLisaValue *valfid = new TMonaLisaValue("fileid",file->GetFileCounter());
797  valuelist->Add(valfid);
798  TString strfid="";
799  strfid+=file->GetFileCounter();
800  TMonaLisaText *valstrfid = new TMonaLisaText("fileid_str",strfid.Data());
801  valuelist->Add(valstrfid);
802 
803  valname = pfx;
804  valname += "readbytes";
805  TMonaLisaValue *valread = new TMonaLisaValue(valname, file->GetBytesRead());
806  valuelist->Add(valread);
807 
808 // TString strbytes_r="";
809 // strbytes_r += file->GetBytesRead();
810 // TMonaLisaText *valstrread = new TMonaLisaText("readbytes_str", strbytes_r.Data());
811 // valuelist->Add(valstrread);
812 
813  valname = pfx;
814  valname += "writtenbytes";
815  TMonaLisaValue *valwrite = new TMonaLisaValue(valname, file->GetBytesWritten());
816  valuelist->Add(valwrite);
817 
818 // TString strbytes_w="";
819 // strbytes_w += file->GetBytesWritten();
820 // TMonaLisaText *valstrwrite = new TMonaLisaText("writtenbytes_str", strbytes_w.Data());
821 // valuelist->Add(valstrwrite);
822 
823  int thput;
824  if (timelapsed > 0.001) {
825  Int_t selapsed = std::round(std::floor(timelapsed * 1000));
826 
827  thput = file->GetBytesRead() / selapsed * 1000;
828  valname = pfx;
829  valname += "filethrpt_rd";
830  TMonaLisaValue *valreadthavg = new TMonaLisaValue(valname, thput);
831  valuelist->Add(valreadthavg);
832 
833  thput = file->GetBytesWritten() / selapsed * 1000;
834  valname = pfx;
835  valname += "filethrpt_wr";
836  TMonaLisaValue *valwritethavg = new TMonaLisaValue(valname, thput);
837  valuelist->Add(valwritethavg);
838  }
839 
840  // And the specific file summary has to be removed from the repo
841  if (mi) {
842  mi->UpdateFileStatus(file);
843  mi->fKillme = kTRUE;
844  }
845 
846  // send it to monalisa
847  success = SendParameters(valuelist);
848 
849 
850  delete valuelist;
851  return success;
852 }
853 ////////////////////////////////////////////////////////////////////////////////
854 
856  return SendFileCheckpoint(file);
857 }
858 ////////////////////////////////////////////////////////////////////////////////
859 
861  return SendFileCheckpoint(file);
862 }
863 ////////////////////////////////////////////////////////////////////////////////
864 
866 {
867  if (!fInitialized) {
868  Error("SendFileCheckpoint",
869  "Monitoring is not properly initialized!");
870  return kFALSE;
871  }
872 
873  if (!file->IsOpen()) return kTRUE;
874 
875  // We cannot handle this kind of ongoing averaged monitoring for a file which has not an unique id. Sorry.
876  // This seems to affect raw files, for which only the Close() info is available
877  // Removing this check causes a mess for non-raw and raw TFiles, because
878  // the UUID in the Init phase has not yet been set, and the traffic
879  // reported during that phase is reported wrongly, causing various leaks and troubles
880  // TFiles without an unique id can be monitored only in their Open/Close event
881  if (!file->TestBit(kHasUUID)) return kTRUE;
882 
883  Double_t timenow = fFileStopwatch.RealTime();
885 
886  // This info has to be gathered in any case.
887 
888  // Check if an MonitoredTFileInfo instance is already available
889  // If not, create one
890  MonitoredTFileInfo *mi = 0;
891  std::map<UInt_t, MonitoredTFileInfo *>::iterator iter = fMonInfoRepo->find(file->GetUniqueID());
892  if (iter != fMonInfoRepo->end()) mi = iter->second;
893  if (!mi) {
894 
895  mi = new MonitoredTFileInfo(file, timenow);
896  if (mi) fMonInfoRepo->insert( make_pair( file->GetUniqueID(), mi ) );
897  }
898 
899  // And now we get those partial values
900  if (mi) mi->UpdateFileStatus(file);
901 
902  // Send the fileread progress to MonaLisa only if required or convenient
903  if ( timenow - fLastRWSendTime < fReportInterval) {
904  // if the progress is not forced, we send maximum 1 every fReportInterval seconds!
905  return kFALSE;
906  }
907 
908  Bool_t success = kFALSE;
909 
910  TList *valuelist = new TList();
911  valuelist->SetOwner(kTRUE);
912 
913  TString valname;
914 
915  // We send only a little throughput summary info
916  // Instead we send the info for the actual file passed
917 
918  TMonaLisaText *valhost = new TMonaLisaText("hostname",fHostname);
919  valuelist->Add(valhost);
920  TMonaLisaText *valsid = new TMonaLisaText("subid", fSubJobId.Data());
921  valuelist->Add(valsid);
922 
923  // First of all, we create an internal summary, sorted by kind of TFile used
924  THashList summary;
925  summary.SetOwner(kTRUE);
926 
927  iter = fMonInfoRepo->begin();
928  if (iter != fMonInfoRepo->end()) mi = iter->second;
929  else mi = 0;
930 
931  while (mi) {
932  MonitoredTFileSummary *sum = static_cast<MonitoredTFileSummary *>(summary.FindObject(mi->fFileClassName));
933  if (!sum) {
934  sum = new MonitoredTFileSummary(mi->fFileClassName);
935  if (sum) summary.AddLast(sum);
936  }
937 
938  if (sum) {
939  sum->Update(mi, timenow, fLastRWSendTime);
940  mi->ResetFileStatus(timenow);
941  }
942 
943  // This could be an info about an already closed file
944  if (mi->fKillme) {
945  iter->second = 0;
946  }
947 
948  iter++;
949  if (iter != fMonInfoRepo->end())
950  mi = iter->second;
951  else
952  mi = 0;
953  }
954 
955  for (iter = fMonInfoRepo->begin(); iter != fMonInfoRepo->end(); iter++)
956  if (!iter->second) fMonInfoRepo->erase(iter);
957 
958  // This info is a summary valid for all the monitored files at once.
959  // It makes no sense at all to send data relative to a specific file here
960  // Cycle through the summary...
961  TIter nxt2(&summary);
962  MonitoredTFileSummary *sum;
963  while ((sum = (MonitoredTFileSummary *)nxt2())) {
964 
965  if (sum->fReadThroughput >= 0) {
966  valname = sum->GetName();
967  valname += "_avgthrpt_rd";
968  TMonaLisaValue *valreadthr = new TMonaLisaValue(valname, sum->fReadThroughput);
969  valuelist->Add(valreadthr);
970  }
971 
972  if ( sum->fWriteThroughput >= 0 ) {
973  valname = sum->GetName();
974  valname += "_avgthrpt_wr";
975  TMonaLisaValue *valwritethr = new TMonaLisaValue(valname, sum->fWriteThroughput);
976  valuelist->Add(valwritethr);
977  }
978 
979  }
980 
981 
982  // send it to monalisa
983  success = SendParameters(valuelist);
984 
985  fLastRWSendTime = timenow;
986 
987  delete valuelist;
988  return success;
989 }
990 
991 ////////////////////////////////////////////////////////////////////////////////
992 /// Send the parameters to MonaLisa.
993 
994 Bool_t TMonaLisaWriter::SendParameters(TList *valuelist, const char *identifier)
995 {
996  if (!fInitialized) {
997  Error("SendParameters", "Monitoring is not properly initialized!");
998  return kFALSE;
999  }
1000 
1001  if (!valuelist) {
1002  Error("SendParameters", "No values in the value list!");
1003  return kFALSE;
1004  }
1005 
1006  if (identifier == 0)
1007  identifier = fJobId;
1008 
1009  TIter nextvalue(valuelist);
1010 
1011  TMonaLisaValue *objval;
1012  TMonaLisaText *objtext;
1013  TObject *monobj;
1014 
1015  Int_t apmon_nparams = valuelist->GetSize();
1016  char **apmon_params = 0;
1017  Int_t *apmon_types = 0;
1018  char **apmon_values = 0;
1019  Double_t *bufDouble = 0; // buffer for int, long, etc. that is to be sent as double
1020 
1021  if (apmon_nparams) {
1022 
1023  apmon_params = (char **) malloc(apmon_nparams * sizeof(char *));
1024  apmon_values = (char **) malloc(apmon_nparams * sizeof(char *));
1025  apmon_types = (int *) malloc(apmon_nparams * sizeof(int));
1026  bufDouble = new Double_t[apmon_nparams];
1027 
1028  Int_t looper = 0;
1029  while ((monobj = nextvalue())) {
1030  if (!strcmp(monobj->ClassName(), "TMonaLisaValue")) {
1031  objval = (TMonaLisaValue *) monobj;
1032 
1033  if (fVerbose)
1034  Info("SendParameters", "adding tag %s with val %f",
1035  objval->GetName(), objval->GetValue());
1036 
1037  apmon_params[looper] = (char *) objval->GetName();
1038  apmon_types[looper] = XDR_REAL64;
1039  apmon_values[looper] = (char *) (objval->GetValuePtr());
1040  looper++;
1041  }
1042  if (!strcmp(monobj->ClassName(), "TMonaLisaText")) {
1043  objtext = (TMonaLisaText *) monobj;
1044 
1045  if (fVerbose)
1046  Info("SendParameters", "adding tag %s with text %s",
1047  objtext->GetName(), objtext->GetText());
1048 
1049  apmon_params[looper] = (char *) objtext->GetName();
1050  apmon_types[looper] = XDR_STRING;
1051  apmon_values[looper] = (char *) (objtext->GetText());
1052  looper++;
1053  }
1054  if (!strcmp(monobj->ClassName(), "TNamed")) {
1055  TNamed* objNamed = (TNamed *) monobj;
1056 
1057  if (fVerbose)
1058  Info("SendParameters", "adding tag %s with text %s",
1059  objNamed->GetName(), objNamed->GetTitle());
1060 
1061  apmon_params[looper] = (char *) objNamed->GetName();
1062  apmon_types[looper] = XDR_STRING;
1063  apmon_values[looper] = (char *) (objNamed->GetTitle());
1064  looper++;
1065  }
1066  // unfortunately ClassName() converts Double_t to double, etc.
1067  if (!strcmp(monobj->ClassName(), "TParameter<double>")) {
1068  TParameter<double>* objParam = (TParameter<double> *) monobj;
1069 
1070  if (fVerbose)
1071  Info("SendParameters", "adding tag %s with val %f",
1072  objParam->GetName(), objParam->GetVal());
1073 
1074  apmon_params[looper] = (char *) objParam->GetName();
1075  apmon_types[looper] = XDR_REAL64;
1076  apmon_values[looper] = (char *) &(objParam->GetVal());
1077  looper++;
1078  }
1079  if (!strcmp(monobj->ClassName(), "TParameter<Long64_t>")) {
1080  TParameter<Long64_t>* objParam = (TParameter<Long64_t> *) monobj;
1081 
1082  if (fVerbose)
1083  Info("SendParameters", "adding tag %s with val %lld",
1084  objParam->GetName(), objParam->GetVal());
1085 
1086  apmon_params[looper] = (char *) objParam->GetName();
1087  apmon_types[looper] = XDR_REAL64;
1088  bufDouble[looper] = objParam->GetVal();
1089  apmon_values[looper] = (char *) (bufDouble + looper);
1090  looper++;
1091  }
1092  if (!strcmp(monobj->ClassName(), "TParameter<long>")) {
1093  TParameter<long>* objParam = (TParameter<long> *) monobj;
1094 
1095  if (fVerbose)
1096  Info("SendParameters", "adding tag %s with val %ld",
1097  objParam->GetName(), objParam->GetVal());
1098 
1099  apmon_params[looper] = (char *) objParam->GetName();
1100  apmon_types[looper] = XDR_REAL64;
1101  bufDouble[looper] = objParam->GetVal();
1102  apmon_values[looper] = (char *) (bufDouble + looper);
1103  looper++;
1104  }
1105  if (!strcmp(monobj->ClassName(), "TParameter<float>")) {
1106  TParameter<float>* objParam = (TParameter<float> *) monobj;
1107 
1108  if (fVerbose)
1109  Info("SendParameters", "adding tag %s with val %f",
1110  objParam->GetName(), objParam->GetVal());
1111 
1112  apmon_params[looper] = (char *) objParam->GetName();
1113  apmon_types[looper] = XDR_REAL64;
1114  bufDouble[looper] = objParam->GetVal();
1115  apmon_values[looper] = (char *) (bufDouble + looper);
1116  looper++;
1117  }
1118  if (!strcmp(monobj->ClassName(), "TParameter<int>")) {
1119  TParameter<int>* objParam = (TParameter<int> *) monobj;
1120 
1121  if (fVerbose)
1122  Info("SendParameters", "adding tag %s with val %d",
1123  objParam->GetName(), objParam->GetVal());
1124 
1125  apmon_params[looper] = (char *) objParam->GetName();
1126  apmon_types[looper] = XDR_REAL64;
1127  bufDouble[looper] = objParam->GetVal();
1128  apmon_values[looper] = (char *) (bufDouble + looper);
1129  looper++;
1130  }
1131  }
1132 
1133  // change number of parameters to the actual found value
1134  apmon_nparams = looper;
1135 
1136  if (fVerbose)
1137  Info("SendParameters", "n: %d name: %s identifier %s ...,",
1138  apmon_nparams, GetName(), identifier);
1139 
1140  ((ApMon *) fApmon)->sendParameters((char *) GetName(), (char*)identifier,
1141  apmon_nparams, apmon_params,
1142  apmon_types, apmon_values);
1143 
1144  free(apmon_params);
1145  free(apmon_values);
1146  free(apmon_types);
1147  delete[] bufDouble;
1148  }
1149  return kTRUE;
1150 }
1151 
1152 ////////////////////////////////////////////////////////////////////////////////
1153 /// Set MonaLisa log level.
1154 
1155 void TMonaLisaWriter::SetLogLevel(const char *loglevel)
1156 {
1157  ((ApMon *) fApmon)->setLogLevel((char *) loglevel);
1158 }
1159 
1160 ////////////////////////////////////////////////////////////////////////////////
1161 /// Print info about MonaLisa object.
1162 
1164 {
1165  std::cout << "Site (Farm) : " << fName << std::endl;
1166  std::cout << "JobId (Node) : " << fJobId << std::endl;
1167  std::cout << "SubJobId (Node) : " << fSubJobId << std::endl;
1168  std::cout << "HostName : " << fHostname << std::endl;
1169  std::cout << "Pid : " << fPid << std::endl;
1170  std::cout << "Inititialized : " << fInitialized << std::endl;
1171  std::cout << "Verbose : " << fVerbose << std::endl;
1172 
1173 }
const char * GetHost() const
Definition: TUrl.h:76
virtual Bool_t SendInfoStatus(const char *status)
Sends a <status> text to MonaLisa following the process scheme: <site> –> <jobid> –> 'status' = <status> Used...
TStopwatch fFileStopwatch
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
virtual Bool_t SendFileWriteProgress(TFile *file)
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:711
virtual Bool_t SendFileCloseEvent(TFile *file)
void AddLast(TObject *obj)
Add object at the end of the list.
Definition: THashList.cxx:90
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Definition: vector.h:433
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
Definition: TStopwatch.cxx:108
void ResetFileStatus(TFile *file, Double_t timenow)
long long Long64_t
Definition: RtypesCore.h:69
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Definition: TStopwatch.cxx:56
TString fHostname
sub job id
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:487
const char Option_t
Definition: RtypesCore.h:62
R__EXTERN TGrid * gGrid
Definition: TGrid.h:135
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:213
Double_t * GetValuePtr()
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Init(const char *monserver, const char *montag, const char *monid, const char *monsubid, const char *option)
Creates a TMonaLisaWriter object to send monitoring information to a MonaLisa server using the MonaLi...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
Definition: TFile.cxx:4311
Double_t GetValue() const
virtual const TUrl * GetEndpointUrl() const
Definition: TFile.h:195
Basic string class.
Definition: TString.h:137
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
Definition: TStopwatch.cxx:123
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Bool_t SendProcessingProgress(Double_t nevent, Double_t nbytes, Bool_t force=kFALSE)
Send the procesing progress to MonaLisa.
Long64_t fLastBytesRead
TStopwatch fStopwatch
TMonaLisaWriter(const TMonaLisaWriter &)
Long64_t fLastBytesWritten
Double_t fLastFCloseSendTime
Long64_t fTempReadBytes
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
Definition: TSystem.cxx:2391
Bool_t fKillme
virtual void SetLogLevel(const char *loglevel="WARNING")
Set MonaLisa log level.
virtual Bool_t SendFileOpenProgress(TFile *file, TList *openphases, const char *openphasename, Bool_t forcesend=kFALSE)
Send the fileopen progress to MonaLisa.
const char * Data() const
Definition: TString.h:349
TString fJobId
connection to MonaLisa
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition: TFile.cxx:1373
Long64_t fTempWrittenBytes
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
virtual Bool_t SendInfoTime()
Sends the current time to MonaLisa following the processing scheme <site> –> <jobid> –> 'time' = >unixtimes...
virtual ~TMonaLisaWriter()
Cleanup.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Bool_t SendInfoUser(const char *user=0)
Sends the <user> text to MonaLisa following the process scheme: <site> –> <jobid> –> 'user' = <user> ...
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1575
if(pyself &&pyself!=Py_None)
Bool_t fInitialized
process id
void Continue()
Resume a stopped stopwatch.
Definition: TStopwatch.cxx:91
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
virtual Bool_t SendParameters(TList *valuelist, const char *identifier=0)
Send the parameters to MonaLisa.
Int_t fReportInterval
repo to gather per-file-instance mon info;
A doubly linked list.
Definition: TList.h:47
Named parameter, streamable and storable.
Definition: TParameter.h:49
TThread * t[5]
Definition: threadsh1.C:13
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
SVector< double, 2 > v
Definition: Dict.h:5
const char * GetName() const
Returns name of object.
Definition: TParameter.h:76
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:187
static Vc_ALWAYS_INLINE Vector< T > round(const Vector< T > &x)
Definition: vector.h:452
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
char * Form(const char *fmt,...)
time_t fLastProgressTime
TString fSubJobId
job id
double floor(double)
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
TString fName
Definition: TNamed.h:36
void UpdateFileStatus(TFile *file)
tuple free
Definition: fildir.py:30
void Print(Option_t *option="") const
Print info about MonaLisa object.
virtual Long64_t GetBytesRead() const
Definition: TFile.h:201
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:581
virtual Int_t GetSize() const
Definition: TCollection.h:95
MonitoredTFileInfo(TFile *file, Double_t timenow)
#define ClassImp(name)
Definition: Rtypes.h:279
tuple file
Definition: fildir.py:20
double Double_t
Definition: RtypesCore.h:55
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:307
virtual Bool_t SendProcessingStatus(const char *status, Bool_t restarttimer=kFALSE)
Send the procesing status 'status' to MonaLisa following the processing scheme: <site> –> <jobid> –> 'statu...
const char * GetUser() const
Definition: TGrid.h:69
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:349
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:433
Mother of all ROOT objects.
Definition: TObject.h:58
while((ob=next()))
Double_t fCreationTime
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:557
virtual void Add(TObject *obj)
Definition: TList.h:81
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
Double_t fLastResetTime
virtual Bool_t SendInfoDescription(const char *jobtag)
Sends the description <jobtag> following the processing scheme: <site> –> <jobid> –> 'jobname' = <jobtag> ...
const char * GetText() const
std::map< UInt_t, MonitoredTFileInfo * > * fMonInfoRepo
const AParamType & GetVal() const
Definition: TParameter.h:77
Double_t fLastRWSendTime
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
Bool_t SendFileCheckpoint(TFile *file)
Vc_ALWAYS_INLINE_L T *Vc_ALWAYS_INLINE_R malloc(size_t n)
Allocates memory on the Heap with alignment and padding suitable for vectorized access.
Definition: memory.h:67
static Long64_t GetFileCounter()
Definition: TFile.cxx:4362
TString fFileClassName
virtual Bool_t SendFileReadProgress(TFile *file)
Int_t fPid
hostname of MonaLisa server
void GetThroughputs(Long64_t &readthr, Long64_t &writethr, Double_t timenow, Double_t prectime)