Exemplo n.º 1
0
def main():
    global opts
    opts = _Options()
    if c_api.pmGetOptionsFromList(sys.argv) != 0:
        c_api.pmUsageMessage()
        sys.exit(1)

    pcp_files = opts.opts.pmGetOptionArchives()
    if pcp_files is None:
        print("Error: No pcp archives specified")
        c_api.pmUsageMessage()
        sys.exit(1)

    print("Parsing: {0}".format(" ".join(map(os.path.basename, pcp_files))),
          end='')
    print()

    pcpstats = pcp2pdf.stats.PcpStats([pcp_files[0]], opts)
    pcpstats.output()
Exemplo n.º 2
0
    ss.init_processor_metrics()
    ss.init_interrupt_metrics()
    ss.init_disk_metrics()
    ss.init_memory_metrics()
    ss.init_network_metrics()

    cpu = _cpuCollectPrint(ss)
    interrupt = _interruptCollectPrint(ss)
    disk = _diskCollectPrint(ss)
    memory = _memoryCollectPrint(ss)
    net = _netCollectPrint(ss)

    # Establish a PMAPI context to archive, host or local, via args
    opts = _Options()
    if c_api.pmGetOptionsFromList(sys.argv) != 0:
        c_api.pmUsageMessage()
        sys.exit(1)

    # Setup some default reporting if none specified so far
    if len(subsys) == 0:
        subsys.append(cpu)
        subsys.append(disk)
        subsys.append(net)
        if opts.create_archive:
            subsys.append(interrupt, memory)

    if opts.duration_arg != 0:
        (timeval, errmsg) = pm.pmParseInterval(str(opts.duration_arg))
        duration = c_api.pmtimevalToReal(timeval)

    pm = pmapi.pmContext.fromOptions(opts.opts, sys.argv)
Exemplo n.º 3
0
    ss.init_processor_metrics()
    ss.init_interrupt_metrics()
    ss.init_disk_metrics()
    ss.init_memory_metrics()
    ss.init_network_metrics()

    cpu = _cpuCollectPrint(ss)
    interrupt = _interruptCollectPrint(ss)
    disk = _diskCollectPrint(ss)
    memory = _memoryCollectPrint(ss)
    net = _netCollectPrint(ss)

    # Establish a PMAPI context to archive, host or local, via args
    opts = _Options()
    if c_api.pmGetOptionsFromList(sys.argv) != 0:
        c_api.pmUsageMessage()
        sys.exit(1)

    # Setup some default reporting if none specified so far
    if len(subsys) == 0:
        subsys.append(cpu)
        subsys.append(disk)
        subsys.append(net)
        if opts.create_archive:
            subsys.append(interrupt)
            subsys.append(memory)

    pm = pmapi.pmContext.fromOptions(opts.opts, sys.argv)
    if pm.type == c_api.PM_CONTEXT_ARCHIVE:
        replay_archive = True
        input_file = opts.opts.pmGetOptionArchives()[0]
Exemplo n.º 4
0
 def usage(self):
     """ Special case the -h option, usually -h/--host in PCP """
     pmUsageMessage()
     sys.exit(0)