def createfake_oldStats(self):
        stats = Stats()
        stats.freeMemory = 0L
        stats.totalMemory = 2097152L
        stats.timestamp = 1331372444.5931201
        stats.ncpus = 1
        stats.diskReadBytes = 226644480L
        stats.diskWriteBytes = 33723392L
        stats.netReceivedBytes = 357325L
        stats.netTransmittedBytes = 8302L
        stats.cpuStats = CPUStats()
        stats.cpuStats.cycles['user'] = 696880000000
        stats.cpuPerfTime = 1331372444.3490119
        stats.diskPerfTime = 1331372444.472137
        stats.netPerfTime = 1331372444.5922019

        return stats
示例#2
0
    def createfake_oldStats(self):
        stats = Stats()
        stats.freeMemory = 0L
        stats.totalMemory = 2097152L
        stats.timestamp = 1331372444.5931201
        stats.ncpus = 1
        stats.diskReadBytes = 226644480L
        stats.diskWriteBytes = 33723392L
        stats.netReceivedBytes = 357325L
        stats.netTransmittedBytes = 8302L
        stats.cpuStats = CPUStats()
        stats.cpuStats.cycles['user'] = 696880000000
        stats.cpuPerfTime = 1331372444.3490119
        stats.diskPerfTime = 1331372444.472137
        stats.netPerfTime = 1331372444.5922019

        return stats
    def createfake_newStats_nochange(self, poweroff, stats_decrement):
        stats = Stats()
        stats.freeMemory = 0L
        stats.totalMemory = 2097152L
        stats.timestamp = 1331372444.5931201
        stats.ncpus = 1
        if poweroff:
            stats.diskReadBytes = 0
        elif stats_decrement:
            stats.diskReadBytes = 226643380L
        else:
            stats.diskReadBytes = 226644480L
        stats.diskWriteBytes = 33723392L
        stats.netReceivedBytes = 357325L
        stats.netTransmittedBytes = 8302L
        stats.cpuStats = CPUStats()
        stats.cpuStats.cycles['user'] = 696880000000
        stats.cpuPerfTime = 1331372444.3490119
        stats.diskPerfTime = 1331372444.472137
        stats.netPerfTime = 1331372444.5922019

        return stats
示例#4
0
    def createfake_newStats_nochange(self, poweroff, stats_decrement):
        stats = Stats()
        stats.freeMemory = 0L
        stats.totalMemory = 2097152L
        stats.timestamp = 1331372444.5931201
        stats.ncpus = 1
        if poweroff:
            stats.diskReadBytes = 0
        elif stats_decrement:
            stats.diskReadBytes = 226643380L
        else:
            stats.diskReadBytes = 226644480L
        stats.diskWriteBytes = 33723392L
        stats.netReceivedBytes = 357325L
        stats.netTransmittedBytes = 8302L
        stats.cpuStats = CPUStats()
        stats.cpuStats.cycles['user'] = 696880000000
        stats.cpuPerfTime = 1331372444.3490119
        stats.diskPerfTime = 1331372444.472137
        stats.netPerfTime = 1331372444.5922019

        return stats
 def createfake_newStats(self, now, status):
     stats = Stats()
     stats.freeMemory = 0L
     stats.totalMemory = 2097152L
     if now:
         stats.timestamp = time.time()
     else:
         stats.timestamp = 1331372625.171705
     stats.ncpus = 1
     stats.diskReadBytes = 226644480L
     stats.diskWriteBytes = 34006016L
     stats.netReceivedBytes = 362137L
     stats.netTransmittedBytes = 8302L
     stats.cpuStats = CPUStats()
     stats.cpuStats.cycles['user'] = 697480000000
     stats.cpuPerfTime = 1331372624.9259009
     stats.diskPerfTime = 1331372625.050205
     stats.netPerfTime = 1331372625.1707871
     if status:
         stats.status = 0
     else:
         stats.status = -1
     return stats
示例#6
0
 def createfake_newStats(self, now, status):
     stats = Stats()
     stats.freeMemory = 0L
     stats.totalMemory = 2097152L
     if now:
         stats.timestamp = time.time()
     else:
         stats.timestamp = 1331372625.171705
     stats.ncpus = 1
     stats.diskReadBytes = 226644480L
     stats.diskWriteBytes = 34006016L
     stats.netReceivedBytes = 362137L
     stats.netTransmittedBytes = 8302L
     stats.cpuStats = CPUStats()
     stats.cpuStats.cycles['user'] = 697480000000
     stats.cpuPerfTime = 1331372624.9259009
     stats.diskPerfTime = 1331372625.050205
     stats.netPerfTime = 1331372625.1707871
     if status:
         stats.status = 0
     else:
         stats.status = -1
     return stats