45#define kMemValuePosMaster 8
46#define kEventNumberPos 13
92 fPlot->
Connect(
"Clicked()",
"TProofProgressMemoryPlot",
this,
"DoPlot()");
147 c->AddEntry(
"average", 0);
170 c->AddEntry(buf.
Data(), is);
208 Error(
"DoPlot",
"TProofProgessDialog instance undefined - protocol error?");
215 Error(
"DoPlot",
"could not get a valid instance of TProofLog");
222 if (!elem) {
Error(
"DoPlot",
"No log elements\n");
return;}
232 TIter nextworker(selected);
254 token = strtok(
name,
" ");
255 if (token && !strcmp(token,
"average")) {
262 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
280 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
296 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
311 const char *role = ple->
GetRole();
321 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
339 legm =
new TLegend(0.1, 0.7, 0.4, 0.9);
359 if (legw) legw->
Draw();
369 if (legm) legm->
Draw();
384 Error(
"DoAveragePlot",
"Empty log");
400 Long64_t vmem = -1, rmem = -1, nevt = -1;
408 const char *role = ple->
GetRole();
409 if (role[0] !=
'w')
continue;
411 if (!lines || lines->
GetSize() <= 0)
continue;
413 if (!curline)
continue;
419 if (maxevent < curevent_value) maxevent = curevent_value;
420 last[ielem] = curevent_value;
429 step = curevent_value - prevevent_value;
437 for (
Int_t i=0; i<ielem; i++){
443 for (
Int_t i=0; i<maxlines; i++){
452 const char *role = ple->
GetRole();
453 if (role[0]!=
'w')
continue;
455 if (!lines || lines->
GetSize() <= 0)
continue;
459 while ((curline = (
TObjString*)prev()) && iline<last[ielem]){
466 av_mem[last[ielem] -1 - iline] += vmem;
467 nw[last[ielem] -1 - iline]++;
468 if (last[ielem] > 0) cur_av += (
Double_t)vmem / last[ielem];
471 if (cur_av > max_av){
475 if (cur_av < min_av){
484 for (
Int_t i=0; i<maxlines; i++){
485 gr->
SetPoint(i, (i+1)*step, av_mem[i]/(nw[i]*1024.));
510 if (
l.IsNull())
return -1;
513 if (
v < 0 &&
r < 0 &&
e < 0)
return 0;
517 if ((from =
l.Index(
"Memory")) ==
kNPOS)
return -1;
525 if (!
l.Tokenize(tok, from,
" "))
return -1;
531 if ((from =
l.Index(
"virtual", from)) ==
kNPOS)
return -1;
533 if (!
l.Tokenize(tok, from,
" "))
return -1;
539 if ((from =
l.Index(
"event", from)) ==
kNPOS)
return -1;
541 if (!
l.Tokenize(tok, from,
" "))
return -1;
561 Long64_t vmem = -1, rmem = -1, nevt = -1;
567 Error(
"DoWorkerPlot",
"error parsing line: '%s'", curline->
String().
Data());
574 if (prevline &&
ParseLine(prevline->
String(), vmem, rmem, prevevent_value) != 0) {
575 Error(
"DoWorkerPlot",
"error parsing line: '%s'", prevline->
String().
Data());
578 Long64_t step = lastevent_value - prevevent_value;
580 Error(
"DoWorkerPlot",
"null or negative step (%lld) - cannot continue", step);
584 Int_t nlines = lastevent_value/step;
590 while ((curline = (
TObjString*)prevl()) && iline<nlines){
597 gr->
SetPoint(nlines-1-iline, lastevent_value-iline*step, vmem/1024.);
620 Long64_t vmem = -1, rmem = -1, nevt = -1;
622 Int_t nlines = iline;
627 while ((curline = (
TObjString*)prevline()) && iline<nlines) {
634 gr->
SetPoint(nlines-iline, nlines-iline, vmem/1024.);
648 for (
Int_t ie=0; ie<nen; ie++) {
const Bool_t kIterBackward
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
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="") override
Remove all primitives from the canvas.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
void Update() override
Update canvas pad buffers.
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 MapWindow()
map window
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 TGraph is an 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.
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