46#define kMemValuePosMaster 8
47#define kEventNumberPos 13
93 fPlot->
Connect(
"Clicked()",
"TProofProgressMemoryPlot",
this,
"DoPlot()");
148 c->AddEntry(
"average", 0);
171 c->AddEntry(buf.
Data(), is);
209 Error(
"DoPlot",
"TProofProgessDialog instance undefined - protocol error?");
216 Error(
"DoPlot",
"could not get a valid instance of TProofLog");
223 if (!elem) {
Error(
"DoPlot",
"No log elements\n");
return;}
233 TIter nextworker(selected);
255 token = strtok(
name,
" ");
256 if (token && !strcmp(token,
"average")) {
263 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
281 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
297 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
312 const char *role = ple->
GetRole();
322 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
340 legm =
new TLegend(0.1, 0.7, 0.4, 0.9);
360 if (legw) legw->
Draw();
370 if (legm) legm->
Draw();
385 Error(
"DoAveragePlot",
"Empty log");
401 Long64_t vmem = -1, rmem = -1, nevt = -1;
409 const char *role = ple->
GetRole();
410 if (role[0] !=
'w')
continue;
412 if (!lines || lines->
GetSize() <= 0)
continue;
414 if (!curline)
continue;
420 if (maxevent < curevent_value) maxevent = curevent_value;
421 last[ielem] = curevent_value;
430 step = curevent_value - prevevent_value;
438 for (
Int_t i=0; i<ielem; i++){
444 for (
Int_t i=0; i<maxlines; i++){
453 const char *role = ple->
GetRole();
454 if (role[0]!=
'w')
continue;
456 if (!lines || lines->
GetSize() <= 0)
continue;
460 while ((curline = (
TObjString*)prev()) && iline<last[ielem]){
467 av_mem[last[ielem] -1 - iline] += vmem;
468 nw[last[ielem] -1 - iline]++;
469 if (last[ielem] > 0) cur_av += (
Double_t)vmem / last[ielem];
472 if (cur_av > max_av){
476 if (cur_av < min_av){
485 for (
Int_t i=0; i<maxlines; i++){
486 gr->
SetPoint(i, (i+1)*step, av_mem[i]/(nw[i]*1024.));
511 if (
l.IsNull())
return -1;
514 if (
v < 0 &&
r < 0 &&
e < 0)
return 0;
518 if ((from =
l.Index(
"Memory")) ==
kNPOS)
return -1;
526 if (!
l.Tokenize(tok, from,
" "))
return -1;
532 if ((from =
l.Index(
"virtual", from)) ==
kNPOS)
return -1;
534 if (!
l.Tokenize(tok, from,
" "))
return -1;
540 if ((from =
l.Index(
"event", from)) ==
kNPOS)
return -1;
542 if (!
l.Tokenize(tok, from,
" "))
return -1;
562 Long64_t vmem = -1, rmem = -1, nevt = -1;
568 Error(
"DoWorkerPlot",
"error parsing line: '%s'", curline->
String().
Data());
575 if (prevline &&
ParseLine(prevline->
String(), vmem, rmem, prevevent_value) != 0) {
576 Error(
"DoWorkerPlot",
"error parsing line: '%s'", prevline->
String().
Data());
579 Long64_t step = lastevent_value - prevevent_value;
581 Error(
"DoWorkerPlot",
"null or negative step (%lld) - cannot continue", step);
585 Int_t nlines = lastevent_value/step;
591 while ((curline = (
TObjString*)prevl()) && iline<nlines){
598 gr->
SetPoint(nlines-1-iline, lastevent_value-iline*step, vmem/1024.);
621 Long64_t vmem = -1, rmem = -1, nevt = -1;
623 Int_t nlines = iline;
628 while ((curline = (
TObjString*)prevline()) && iline<nlines) {
635 gr->
SetPoint(nlines-iline, nlines-iline, vmem/1024.);
649 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.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MapWindow()
map window
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
A listbox is a box, possibly with scrollbar, containing entries.
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
Yield an action as soon as it is clicked.
Text string listbox entries.
const TGString * GetText() const
Defines transient windows that typically are used for dialogs windows.
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
A composite frame that layout their children in vertical way.
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)
This class provides a query progress bar.
TProofProgressMemoryPlot * fMemWindow
This class implements a dialog, used to display the memory footprint on the proof workers and master.
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.
This class creates a TGCanvas in which a TCanvas is created.
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