stats.py (2006:3ca085495c69) | stats.py (2187:494da52c4eac) |
---|---|
1#!/usr/bin/env python 2 3# Copyright (c) 2003-2004 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 248 unchanged lines hidden (view full) --- 257 if options.ticks: 258 if not options.graph: 259 print 'only displaying sample %s' % options.ticks 260 source.ticks = [ int(x) for x in options.ticks.split() ] 261 262 from output import StatOutput 263 output = StatOutput(options.jobfile, source) 264 output.xlabel = 'System Configuration' | 1#!/usr/bin/env python 2 3# Copyright (c) 2003-2004 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 248 unchanged lines hidden (view full) --- 257 if options.ticks: 258 if not options.graph: 259 print 'only displaying sample %s' % options.ticks 260 source.ticks = [ int(x) for x in options.ticks.split() ] 261 262 from output import StatOutput 263 output = StatOutput(options.jobfile, source) 264 output.xlabel = 'System Configuration' |
265 output.colormap = 'RdYlGn' |
|
265 266 if command == 'stat' or command == 'formula': 267 if len(args) != 1: 268 raise CommandException 269 270 if command == 'stat': 271 stats = source.getStat(args[0]) 272 if command == 'formula': --- 8 unchanged lines hidden (view full) --- 281 output.display(stat.name, options.binned, options.printmode) 282 283 return 284 285 if len(args): 286 raise CommandException 287 288 from info import ProxyGroup | 266 267 if command == 'stat' or command == 'formula': 268 if len(args) != 1: 269 raise CommandException 270 271 if command == 'stat': 272 stats = source.getStat(args[0]) 273 if command == 'formula': --- 8 unchanged lines hidden (view full) --- 282 output.display(stat.name, options.binned, options.printmode) 283 284 return 285 286 if len(args): 287 raise CommandException 288 289 from info import ProxyGroup |
289 sim_seconds = source['sim_seconds'] | |
290 proxy = ProxyGroup(system = source[options.system]) 291 system = proxy.system 292 293 etherdev = system.tsunami.etherdev0 294 bytes = etherdev.rxBytes + etherdev.txBytes 295 kbytes = bytes / 1024 296 packets = etherdev.rxPackets + etherdev.txPackets | 290 proxy = ProxyGroup(system = source[options.system]) 291 system = proxy.system 292 293 etherdev = system.tsunami.etherdev0 294 bytes = etherdev.rxBytes + etherdev.txBytes 295 kbytes = bytes / 1024 296 packets = etherdev.rxPackets + etherdev.txPackets |
297 bps = etherdev.rxBandwidth + etherdev.txBandwidth | |
298 299 def display(): 300 if options.graph: 301 output.graph(command, options.graphdir, proxy) 302 else: 303 output.display(command, options.binned, options.printmode) 304 305 if command == 'usertime': --- 26 unchanged lines hidden (view full) --- 332 333 if command == 'ppt' or command == 'tpp': 334 output.stat = packets / system.run0.numCycles 335 output.invert = command == 'tpp' 336 display() 337 return 338 339 if command == 'pps': | 297 298 def display(): 299 if options.graph: 300 output.graph(command, options.graphdir, proxy) 301 else: 302 output.display(command, options.binned, options.printmode) 303 304 if command == 'usertime': --- 26 unchanged lines hidden (view full) --- 331 332 if command == 'ppt' or command == 'tpp': 333 output.stat = packets / system.run0.numCycles 334 output.invert = command == 'tpp' 335 display() 336 return 337 338 if command == 'pps': |
340 output.stat = packets / sim_seconds | 339 output.stat = packets / source['sim_seconds'] |
341 output.ylabel = 'Packets/s' 342 display() 343 return 344 345 if command == 'bpt' or command == 'tpb': 346 output.stat = bytes / system.run0.numCycles * 8 347 output.ylabel = 'bps / Hz' 348 output.invert = command == 'tpb' 349 display() 350 return 351 352 if command in ('rxbps', 'txbps', 'bps'): 353 if command == 'rxbps': 354 output.stat = etherdev.rxBandwidth / 1e9 355 if command == 'txbps': 356 output.stat = etherdev.txBandwidth / 1e9 357 if command == 'bps': | 340 output.ylabel = 'Packets/s' 341 display() 342 return 343 344 if command == 'bpt' or command == 'tpb': 345 output.stat = bytes / system.run0.numCycles * 8 346 output.ylabel = 'bps / Hz' 347 output.invert = command == 'tpb' 348 display() 349 return 350 351 if command in ('rxbps', 'txbps', 'bps'): 352 if command == 'rxbps': 353 output.stat = etherdev.rxBandwidth / 1e9 354 if command == 'txbps': 355 output.stat = etherdev.txBandwidth / 1e9 356 if command == 'bps': |
358 output.stat = bps / 1e9 | 357 output.stat = (etherdev.rxBandwidth + etherdev.txBandwidth) / 1e9 |
359 360 output.ylabel = 'Bandwidth (Gbps)' 361 output.ylim = [ 0.0, 10.0 ] 362 display() 363 return 364 365 if command == 'bpp': 366 output.stat = bytes / packets --- 148 unchanged lines hidden --- | 358 359 output.ylabel = 'Bandwidth (Gbps)' 360 output.ylim = [ 0.0, 10.0 ] 361 display() 362 return 363 364 if command == 'bpp': 365 output.stat = bytes / packets --- 148 unchanged lines hidden --- |