pcp
[Top] [All Lists]

pmrep: drop redundant code

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pmrep: drop redundant code
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 18 Jan 2016 11:27:05 +0200
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
Tiny leftover from the early days.

Passing values to report() could also seen as redundant but I
think it's best to recheck that if/when we modularize the code.

---
 src/pmrep/pmrep.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index c7b5ea5..a885e2d 100644
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -844,7 +844,7 @@ class PMReporter(object):
                     continue
                 raise error
             self.context.pmSortInstances(result) # XXX Is this really needed?
-            values = self.extract(result)
+            self.extract(result)
             if self.ctstamp == 0:
                 self.ctstamp = copy.copy(result.contents.timestamp)
             self.ptstamp = self.ctstamp
@@ -857,7 +857,7 @@ class PMReporter(object):
                 if float(self.ctstamp) > float(self.opts.pmGetOptionFinish()):
                     return
 
-            self.report(self.ctstamp, values)
+            self.report(self.ctstamp, self.currvals)
             self.context.pmFreeResult(result)
             if self.samples and self.samples > 0:
                 self.samples -= 1
@@ -951,8 +951,6 @@ class PMReporter(object):
         self.prevvals = self.currvals
         self.currvals = values
 
-        return values # XXX Redundant now
-
     def report(self, tstamp, values):
         """ Report the metric values """
         if tstamp != None:

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>
  • pmrep: drop redundant code, Marko Myllynen <=