44#define kMemValuePosMaster 8
45#define kEventNumberPos 13
91 fPlot->
Connect(
"Clicked()",
"TProofProgressMemoryPlot",
this,
"DoPlot()");
146 c->AddEntry(
"average", 0);
169 c->AddEntry(buf.
Data(), is);
207 Error(
"DoPlot",
"TProofProgessDialog instance undefined - protocol error?");
214 Error(
"DoPlot",
"could not get a valid instance of TProofLog");
221 if (!elem) {
Error(
"DoPlot",
"No log elements\n");
return;}
231 TIter nextworker(selected);
253 token = strtok(
name,
" ");
254 if (token && !strcmp(token,
"average")) {
261 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
279 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
295 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
310 const char *role = ple->
GetRole();
320 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
338 legm =
new TLegend(0.1, 0.7, 0.4, 0.9);
358 if (legw) legw->
Draw();
368 if (legm) legm->
Draw();
383 Error(
"DoAveragePlot",
"Empty log");
399 Long64_t vmem = -1, rmem = -1, nevt = -1;
407 const char *role = ple->
GetRole();
408 if (role[0] !=
'w')
continue;
410 if (!lines || lines->
GetSize() <= 0)
continue;
412 if (!curline)
continue;
418 if (maxevent < curevent_value) maxevent = curevent_value;
419 last[ielem] = curevent_value;
428 step = curevent_value - prevevent_value;
436 for (
Int_t i=0; i<ielem; i++){
442 for (
Int_t i=0; i<maxlines; i++){
451 const char *role = ple->
GetRole();
452 if (role[0]!=
'w')
continue;
454 if (!lines || lines->
GetSize() <= 0)
continue;
458 while ((curline = (
TObjString*)prev()) && iline<last[ielem]){
465 av_mem[last[ielem] -1 - iline] += vmem;
466 nw[last[ielem] -1 - iline]++;
467 if (last[ielem] > 0) cur_av += (
Double_t)vmem / last[ielem];
470 if (cur_av > max_av){
474 if (cur_av < min_av){
483 for (
Int_t i=0; i<maxlines; i++){
484 gr->
SetPoint(i, (i+1)*step, av_mem[i]/(nw[i]*1024.));
509 if (
l.IsNull())
return -1;
512 if (
v < 0 &&
r < 0 &&
e < 0)
return 0;
516 if ((from =
l.Index(
"Memory")) ==
kNPOS)
return -1;
524 if (!
l.Tokenize(tok, from,
" "))
return -1;
530 if ((from =
l.Index(
"virtual", from)) ==
kNPOS)
return -1;
532 if (!
l.Tokenize(tok, from,
" "))
return -1;
538 if ((from =
l.Index(
"event", from)) ==
kNPOS)
return -1;
540 if (!
l.Tokenize(tok, from,
" "))
return -1;
560 Long64_t vmem = -1, rmem = -1, nevt = -1;
566 Error(
"DoWorkerPlot",
"error parsing line: '%s'", curline->
String().
Data());
573 if (prevline &&
ParseLine(prevline->
String(), vmem, rmem, prevevent_value) != 0) {
574 Error(
"DoWorkerPlot",
"error parsing line: '%s'", prevline->
String().
Data());
577 Long64_t step = lastevent_value - prevevent_value;
579 Error(
"DoWorkerPlot",
"null or negative step (%lld) - cannot continue", step);
583 Int_t nlines = lastevent_value/step;
589 while ((curline = (
TObjString*)prevl()) && iline<nlines){
596 gr->
SetPoint(nlines-1-iline, lastevent_value-iline*step, vmem/1024.);
619 Long64_t vmem = -1, rmem = -1, nevt = -1;
621 Int_t nlines = iline;
626 while ((curline = (
TObjString*)prevline()) && iline<nlines) {
633 gr->
SetPoint(nlines-iline, nlines-iline, vmem/1024.);
647 for (
Int_t ie=0; ie<nen; ie++) {
const Bool_t kIterBackward
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
void Clear(Option_t *option="")
Remove all primitives from the canvas.
virtual void Update()
Update canvas pad buffers.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
virtual Int_t GetNumberOfEntries() const
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
const char * GetString() const
const TGString * GetText() const
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void SetHeader(const char *header="", Option_t *option="")
Sets the header, which is the "title" that appears at the top of the legend.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
TList * GetListOfLines() const
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
TAxis * GetYaxis()
Get y axis of the graph.
TAxis * GetXaxis()
Get x axis of the graph.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TMacro * GetMacro() const
TList * GetListOfLogs() const
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
virtual TProofLog * GetSessionLogs(Int_t=0, const char *=0, const char *="-v \"| SvcMsg\"", Bool_t=kFALSE)
TProofProgressMemoryPlot * fMemWindow
TRootEmbeddedCanvas * fWorkersPlot
TGListBox * BuildLogList(TGFrame *parent)
Build the list of workers.
TProofProgressDialog * fDialog
TGraph * DoMasterPlot(TProofLogElem *ple)
a master or submaster log display without meaningful labels for now
TGraph * DoWorkerPlot(TProofLogElem *ple)
Make a memory consumption graph for a worker.
TRootEmbeddedCanvas * fMasterPlot
TGSplitButton * fAllWorkers
TProofProgressMemoryPlot(TProofProgressDialog *d, Int_t w=700, Int_t h=300)
Main constructor.
Int_t ParseLine(TString l, Long64_t &v, Long64_t &r, Long64_t &e)
Extract from line 'l' the virtual memory 'v', the resident memory 'r' and the number of events 'e'.
void DoPlot()
Draw the plot from the logs.
void Select(Int_t id)
actions of select all/clear all button
virtual ~TProofProgressMemoryPlot()
Destructor.
TGraph * DoAveragePlot(Int_t &max_el, Int_t &min_el)
Create the average plots.
void Clear(Option_t *=0)
Clear the canvases.
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
const char * GetMaster() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
TCanvas * GetCanvas() const
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Long64_t Atoll() const
Return long long value of string.
This class represents a WWW compatible URL.
const char * GetHost() const