battery-historian: Index | Files

package activity

import ""

Package activity parses activity manager events in bugreport files and outputs CSV entries for those events.


Package Files



const (

    // EventLogSection is the heading found in the log line before the start of the event log section.
    EventLogSection = "EVENT LOG"
    // SystemLogSection is the heading found in the log line before the start of the system log section.
    SystemLogSection = "SYSTEM LOG"
    // LastLogcatSection is the heading found in the log line before the start of the last logcat section.
    LastLogcatSection = "LAST LOGCAT"

type Log Uses

type Log struct {
    StartMs int64
    CSV     string

Log contains the CSV generated from the log as well as the start time of the log.

type LogsData Uses

type LogsData struct {
    // Logs is a map from section name to Log data.
    Logs     map[string]*Log
    Warnings []string
    Errs     []error

LogsData contains the CSV generated from the system and event logs and the start times of the logs.

func Parse Uses

func Parse(pkgs []*usagepb.PackageInfo, f string) LogsData

Parse writes a CSV entry for each line matching activity manager proc start and died, ANR and low memory events. Package info is used to match crash events to UIDs. Errors encountered during parsing will be collected into an errors slice and will continue parsing remaining events.

func (LogsData) String Uses

func (ld LogsData) String() string

String returns a string representation of the LogsData.

type SystemUIDecoder Uses

type SystemUIDecoder map[int32]string

SystemUIDecoder maps from IDs found in sysui events to the corresponding event name. frameworks/base/proto/src/metrics_constants.proto

func Decoder Uses

func Decoder() SystemUIDecoder

Decoder returns the decoder map for sysui events.

func (SystemUIDecoder) MarshalJSON Uses

func (s SystemUIDecoder) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface to marshal SystemUIDecoder into valid JSON.

Package activity imports 14 packages (graph) and is imported by 2 packages. Updated 2017-06-12. Refresh now. Tools for package owners.