+ yield rowformat([category, stat, str(val), max_rate, tot])
+
+ def _text_report_agg_gen(self, aggformat):
+ by_single_task = ""
+ if len(self.tasks) > 1:
+ by_single_task = " by a single task"
+
+ metrics = [
+ ('Elapsed time',
+ self.elapsed_time(),
+ None,
+ ''),
+
+ ('Estimated cost',
+ '${:.3f}'.format(self.cost),
+ None,
+ '') if self.cost > 0 else None,
+
+ ('Assigned instance type',
+ self.node_info.get('ProviderType'),
+ None,
+ '') if self.node_info.get('ProviderType') else None,
+
+ ('Instance hourly price',
+ '${:.3f}'.format(self.node_info.get('Price')),
+ None,
+ '') if self.node_info.get('Price') else None,
+
+ ('Max CPU usage in a single interval',
+ self.stats_max['cpu']['user+sys__rate'],
+ lambda x: x * 100,
+ '%'),
+
+ ('Overall CPU usage',
+ float(self.job_tot['cpu']['user+sys']) /
+ self.job_tot['time']['elapsed']
+ if self.job_tot['time']['elapsed'] > 0 else 0,
+ lambda x: x * 100,
+ '%'),
+
+ ('Requested CPU cores',
+ self.existing_constraints.get(self._map_runtime_constraint('vcpus')),
+ None,
+ '') if self.existing_constraints.get(self._map_runtime_constraint('vcpus')) else None,
+
+ ('Instance VCPUs',
+ self.node_info.get('VCPUs'),
+ None,
+ '') if self.node_info.get('VCPUs') else None,
+
+ ('Max memory used{}'.format(by_single_task),
+ self.stats_max['mem']['rss'],
+ lambda x: x / 2**20,
+ 'MB'),
+
+ ('Requested RAM',
+ self.existing_constraints.get(self._map_runtime_constraint('ram')),
+ lambda x: x / 2**20,
+ 'MB') if self.existing_constraints.get(self._map_runtime_constraint('ram')) else None,
+
+ ('Maximum RAM request for this instance type',
+ (self.node_info.get('RAM') - self.arv_config.get('Containers', {}).get('ReserveExtraRAM', 0))*.95,
+ lambda x: x / 2**20,
+ 'MB') if self.node_info.get('RAM') else None,
+
+ ('Max network traffic{}'.format(by_single_task),
+ self.stats_max['net:eth0']['tx+rx'] +
+ self.stats_max['net:keep0']['tx+rx'],
+ lambda x: x / 1e9,
+ 'GB'),
+
+ ('Max network speed in a single interval',
+ self.stats_max['net:eth0']['tx+rx__rate'] +
+ self.stats_max['net:keep0']['tx+rx__rate'],
+ lambda x: x / 1e6,
+ 'MB/s'),
+
+ ('Keep cache miss rate',
+ (float(self.job_tot['keepcache']['miss']) /
+ float(self.job_tot['keepcalls']['get']))
+ if self.job_tot['keepcalls']['get'] > 0 else 0,
+ lambda x: x * 100.0,
+ '%'),
+
+ ('Keep cache utilization',
+ (float(self.job_tot['blkio:0:0']['read']) /
+ float(self.job_tot['net:keep0']['rx']))
+ if self.job_tot['net:keep0']['rx'] > 0 else 0,
+ lambda x: x * 100.0,
+ '%'),
+
+ ('Temp disk utilization',
+ (float(self.job_tot['statfs']['used']) /
+ float(self.job_tot['statfs']['total']))
+ if self.job_tot['statfs']['total'] > 0 else 0,
+ lambda x: x * 100.0,
+ '%'),
+ ]
+
+ if len(self.tasks) > 1:
+ metrics.insert(0, ('Number of tasks',