Hi Daniel,

> > Currently connman only has one set of counters for
> > collecting statistics on online time and
> > the amount of transfered bytes.
> > 
> > For 3G connections we should destinguish between
> > home network and roaming. This patch introduces
> > two sets of counter values for home network
> > and roaming network.
> > ---
> > 
> > First 'complete' version of this patch. I haven't yet tested the roaming 
> > with the
> > 3G connection. From reading the code, only 3G would work right now.
> > 
> > v2: - Added the juicy part, switching the stats according the state
> >       of service->roaming
> > v1: - Rebase to head
> >     - Use two dictionaries home and roaming in Usage() as descriped in 
> > documentationw
> >     - Remove test-connman patch leftovers
> > v0: - initial version
> >     - The Counter API should be done and is ready for review. 
> >     - The inner logic is still missing.
> 
> I'm not so sure doing the home/roaming on service level is
> correct. Consider following case: I'm travelling from Germany to Italy
> for a couple of days and then to Switzerland. The roaming statistics
> would not distinguish between Italy and Switzerland. The prolbem is
> that the roaming costs are different for both countries. So I'd like
> to have different statistics for both countries. 
> 
> If I understand correctly the statistic counters should be in the
> Network objects and not in the Service objects. Counter exposes the
> Service as statistic source. Service could act as statistic proxy for
> Network. In this case the Counter API doesn't have to change. But how
> does this work out with different roaming counters? Counter API has
> justs one home and _one_ roaming dict. Roaming counters could then
> jump when we roam from one Network to another. At least the current
> roaming ID would be nice to have. But then why not just expose only
> one active statistic dictionary with an ID? It doesn't matter if home
> or roaming. 

the network structs will be removed soon. We wanna simplify the internal
APIs of ConnMan on a massive scale.

And while I see your point with different countries and different
pricing models, it doesn't really matter. The difference here is home vs
non-home (roaming) counting. Not counting on a country level.

The main focus is to figure out how much traffic/time you have spent
outside your home network.

> Also the next question is how to access all stats, not only the
> ready/online ones. IRC, we don't want to have them exposed as
> properties in Network or Service. So Counter is the next place to a
> feature like this. 
> 
> The simplest version I can come up is something like this:
> 
>         void GetAllStats()
> 
>                Returns a list of known stats.
> 
>         void GetStats(string name)
> 
>                Return stats dict for given name.
> 
> But I don't like very much, somehow now really going well with the
> rest of the API. 
> 
> The next think I is alike the org.moblin.connman.Manager interface
> which exposes all known Services through GetServices(). So there could
> be something like GetCounters() in Manager which gives a list of all
> Counters. Of course this would change the Counter Client interaction a
> bit. Instead of creating a Counter only on request for a client there
> would be all Counters available and a client just activates a Counter
> to update itself.
> 
> If we want to keep the existing interaction we could do something like
> 
> CounterManager
>  +- Counter
>  +- Counter
>  +- ...
> 
> CounterManager 
> 
>    void Usage(object service, current stats dict)
> 
>        The current used stats dictionary.
> 
>    void GetCurrentCounter()
> 
>        Returns the current used Counter object for statistics.
> 
>    void GetAllCounters()
> 
>        Return all Counter
> 
> 
> What do you think?

In the end, I do wanna record sessions and provide these information
back to the user. So first of all, we have to be able to be doing
exactly this.

I looked at SQLite and RRD and both are a bit too generic and drag in a
bit too much dependencies for my taste. So we might need to create
something by ourselves that allows us to create persistent session
statistics.

Current idea is to store everything under /var/lib/connman/counter/ with
the service identifier (wifi_xxxx_managed_none etc.) and then suffix
like *.info for the summary and *.data for the actual session data.

When we have that, then we need to think about how we can present this
to an end user. And my idea here is that we just present it via some
sort of timeline. Simple example would be monthly or daily etc.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to