[ARVADOS] updated: 1.3.0-524-g0e0cbc439

Git user git at public.curoverse.com
Tue Mar 19 20:27:36 UTC 2019


Summary of changes:
 services/fuse/arvados_fuse/__init__.py   | 39 ++++++++++++++++----------------
 services/fuse/arvados_fuse/crunchstat.py | 10 ++++----
 2 files changed, 26 insertions(+), 23 deletions(-)

       via  0e0cbc43912e4bd8ad3fda616e552380d61c3f8d (commit)
      from  daa4ee15fdf51a573f96b74c9fd01747b63bbeb0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 0e0cbc43912e4bd8ad3fda616e552380d61c3f8d
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Tue Mar 19 16:27:00 2019 -0400

    14645: Adds op counts to reporting
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 1ca3a0dc1..b37ef695b 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -413,25 +413,26 @@ class Operations(llfuse.Operations):
         # initializing to continue
         self.initlock.set()
 
-    def time_samples(self):
-        metrics = self.fuse_time.collect()
-
-        # We should have one parent summary metric, and child summaries for each op
-        if len(metrics) != 1:
-            _logger.warning("arv-mount metrics: invalid number of prometheus Summary metrics")
-            return [] 
-        return metrics[0].samples
-
-    def time_sum_samples(self):
-        return [sample for sample in self.time_samples() if sample.name == 'arvmount_fuse_operations_seconds_sum']
-
-    def time_sum_value(self, opname):
-        for op_sum in self.time_sum_samples():
-            if op_sum.labels['op'] == opname:
-                return op_sum.value
-
-    def time_sum_value_func(self, opname):
-        return lambda: self.time_sum_value(opname)
+    def metric_samples(self):
+        return self.fuse_time.collect()[0].samples 
+
+    def metric_op_names(self):
+        ops = []
+        for cur_op in [sample.labels['op'] for sample in self.metric_samples()]:
+            if cur_op not in ops:
+                ops.append(cur_op)
+        return ops
+
+    def metric_value(self, opname, metric):
+        op_value = [sample.value for sample in self.metric_samples()
+                    if sample.name == metric and sample.labels['op'] == opname]
+        return op_value[0] if len(op_value) == 1 else None
+
+    def metric_sum_func(self, opname):
+        return lambda: self.metric_value(opname, "arvmount_fuse_operations_seconds_sum")
+
+    def metric_count_func(self, opname):
+        return lambda: int(self.metric_value(opname, "arvmount_fuse_operations_seconds_count"))
 
     @destroy_time.time()
     @catch_exceptions
diff --git a/services/fuse/arvados_fuse/crunchstat.py b/services/fuse/arvados_fuse/crunchstat.py
index a21ca3140..ea6dd5b35 100644
--- a/services/fuse/arvados_fuse/crunchstat.py
+++ b/services/fuse/arvados_fuse/crunchstat.py
@@ -56,10 +56,12 @@ def statlogger(interval, keep, ops):
         Stat("read", ops.read_ops_counter.get)
     ])
     fusetimes = []
-    for sample in ops.time_sum_samples():   
-        cur_op = sample.labels['op']   
-        fusetimes.append(StatWriter("fuseopstime", interval, [
-            Stat(cur_op, ops.time_sum_value_func(cur_op))
+    for cur_op in ops.metric_op_names():   
+        fusetimes.append(StatWriter("fuseop:count", interval, [
+            Stat(cur_op, ops.metric_count_func(cur_op))
+        ]))
+        fusetimes.append(StatWriter("fuseop:time", interval, [
+            Stat(cur_op, ops.metric_sum_func(cur_op))
         ]))
     blk = StatWriter("blkio:0:0", interval, [
         Stat("write", ops.write_counter.get),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list