43 #define kMemValuePos 8 44 #define kMemValuePosMaster 8 45 #define kEventNumberPos 13 91 fPlot->
Connect(
"Clicked()",
"TProofProgressMemoryPlot",
this,
"DoPlot()");
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")) {
256 if (gr && gr->
GetN()>0){
261 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
274 if (gr && gr->
GetN()>0){
279 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
290 if (gr && gr->
GetN()>0){
295 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
310 const char *role = ple->
GetRole();
315 if (gr && gr->
GetN()>0) {
320 legw =
new TLegend(0.1, 0.7, 0.4, 0.9);
333 if (gr && gr->
GetN()>0){
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++) {
TGListBox * BuildLogList(TGFrame *parent)
Build the list of workers.
virtual const char * GetName() const
Returns name of object.
TList * GetListOfLines() const
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
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 void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
This class displays a legend box (TPaveText) containing several legend entries.
Collectable string class.
TGraph * DoAveragePlot(Int_t &max_el, Int_t &min_el)
Create the average plots.
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
TGraph * DoWorkerPlot(TProofLogElem *ple)
Make a memory consumption graph for a worker.
This class represents a WWW compatible URL.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual Int_t GetEntries() const
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
A TMultiGraph is a collection of TGraph (or derived) objects.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
TRootEmbeddedCanvas * fWorkersPlot
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
virtual TProofLog * GetSessionLogs(Int_t=0, const char *=0, const char *="-v \ SvcMsg\, Bool_t=kFALSE)
TProofProgressMemoryPlot(TProofProgressDialog *d, Int_t w=700, Int_t h=300)
Main constructor.
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
TAxis * GetXaxis()
Get x axis of the graph.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TMacro * GetMacro() const
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
void Clear(Option_t *option="")
Remove all primitives from the canvas.
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
Long64_t Atoll() const
Return long long value of string.
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
virtual ~TProofProgressMemoryPlot()
Destructor.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TGraph * DoMasterPlot(TProofLogElem *ple)
a master or submaster log display without meaningful labels for now
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...
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
TRootEmbeddedCanvas * fMasterPlot
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TAxis * GetYaxis()
Get y axis of the graph.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual Int_t GetNumberOfEntries() const
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'...
const char * GetString() const
TList * GetListOfLogs() const
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
void DoPlot()
Draw the plot from the logs.
const TGString * GetText() const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
TCanvas * GetCanvas() const
const char * GetMaster() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
void Select(Int_t id)
actions of select all/clear all button
TProofProgressDialog * fDialog
TGSplitButton * fAllWorkers
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
TProofProgressMemoryPlot * fMemWindow
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.
const Bool_t kIterBackward
virtual void Update()
Update canvas pad buffers.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual const char * GetTitle() const
Returns title of object.
void Clear(Option_t *=0)
Clear the canvases.
const char * Data() const
virtual void SetHeader(const char *header="", Option_t *option="")
Sets the header, which is the "title" that appears at the top of the legend.