Example #1
0
def parse_report_line(lines):
    java_vm_heap_size = DEFAULT_NULL_CONTENT
    java_vm_heap_alloc = DEFAULT_NULL_CONTENT
    total_mem = DEFAULT_NULL_CONTENT
    app_views = DEFAULT_NULL_CONTENT
    app_activities = DEFAULT_NULL_CONTENT

    for line in lines:
        if 'Dalvik Heap' in line:
            java_vm_heap_size, java_vm_heap_alloc = parse_java_vm_heap_size(
                line)
        elif 'TOTAL' in line:
            total_mem = parse_total_mem(line)
        elif ' Views:' in line:
            app_views = parse_app_views(line)
        elif 'Activities:' in line:
            app_activities = parse_app_activities(line)

    java_vm_heap_size = format_mem_size(java_vm_heap_size)
    java_vm_heap_alloc = format_mem_size(java_vm_heap_alloc)
    total_mem = format_mem_size(total_mem)
    cur_time = MUtils.g_get_current_time()
    tmp_fields = (cur_time, total_mem, java_vm_heap_size, java_vm_heap_alloc,
                  app_activities, app_views)
    return MUtils.g_report_limiter.join(tmp_fields)
def parse_report_line(lines):
    java_vm_heap_size = DEFAULT_NULL_CONTENT
    java_vm_heap_alloc = DEFAULT_NULL_CONTENT
    total_mem = DEFAULT_NULL_CONTENT
    app_views = DEFAULT_NULL_CONTENT
    app_activities = DEFAULT_NULL_CONTENT

    for line in lines:
        if 'Dalvik Heap' in line:
            java_vm_heap_size, java_vm_heap_alloc = parse_java_vm_heap_size(line)
        elif 'TOTAL' in line:
            total_mem = parse_total_mem(line)
        elif ' Views:' in line:
            app_views = parse_app_views(line)
        elif 'Activities:' in line:
            app_activities = parse_app_activities(line)

    java_vm_heap_size = format_mem_size(java_vm_heap_size)
    java_vm_heap_alloc = format_mem_size(java_vm_heap_alloc)
    total_mem = format_mem_size(total_mem)
    cur_time = MUtils.g_get_current_time()
    tmp_fields = (cur_time, total_mem, java_vm_heap_size, java_vm_heap_alloc, app_activities, app_views)
    return MUtils.g_report_limiter.join(tmp_fields)
Example #3
0
def write_report_line_with_time_in_file(f_report, write_line):
    cur_time = MUtils.g_get_current_time()
    tmp_line = cur_time + '  ' + write_line.replace('\r\n', '\n')
    print tmp_line
    f_report.write(tmp_line)
    f_report.flush()
Example #4
0
def run_top_cmd_for_pkg_and_write_output(f_report):
    write_line = '%s   %s' % (MUtils.g_get_current_time(), run_top_command_for_pkg())
    write_single_line_report(f_report, write_line)
    f_report.flush()
Example #5
0
def build_prefix_for_top_cmd_output_line():
    cur_time = MonitorUtils.g_get_current_time()
    return '%s -----------------------------------' % (cur_time)
def run_top_cmd_for_pkg_and_write_output(f_report):
    write_line = '%s   %s' % (MUtils.g_get_current_time(),
                              run_top_command_for_pkg())
    write_single_line_report(f_report, write_line)
    f_report.flush()