google / battery-historian

Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.
Other
5.32k stars 956 forks source link

Network Information missing #134

Open mhdatie opened 7 years ago

mhdatie commented 7 years ago

Hey,

I ran docker and created a bug report to check device activity but I can't seem to find the Network Information option under App Stats. Was this a feature in an older version or is there a way to enable that with the current stable version?

Thanks

mhdatie commented 7 years ago

More Info:

aggregated_stats.go

wr := app.Network.GetWifiBytesRx()
wt := app.Network.GetWifiBytesTx()
mt := app.Network.GetMobileBytesTx()
mr := app.Network.GetMobileBytesRx()
if wr+wt+mt+mr >= 0.01 {
    ntd := NetworkTrafficData{
            Name:            app.GetName(),
            UID:             app.GetUid(),
            WifiMegaBytes:   (wr + wt) / (1024 * 1024),
            MobileMegaBytes: (mr + mt) / (1024 * 1024),
        }
    if realtime > 0 {
        ntd.WifiMegaBytesPerHour = (wr + wt) / (1024 * 1024) / float32(realtime.Hours())
        ntd.MobileMegaBytesPerHour = (mr + mt) / (1024 * 1024) / float32(realtime.Hours())
    }
    n = append(n, &ntd)
    this.Network = ntd
}

Now I see this network information under WiFi Traffic Per App which means:

app_stats.js # displayAppNetworkInfo() first param is of type batterystats.BatteryStats.App.Network and in that method, if any of the params is defined, then the show() on the Network div is called.

According to the logic in the source code I should be seeing the Network Information section but for some reason I don't. Is there anything I am missing here? My next bet is to try and remove that if statement and always show the network section.

Any guidance is appreciated