[Sugar-devel] Time spent on activity (was Best time format for logging?)
Manuel Quiñones
manuq at laptop.org
Fri Mar 28 08:49:10 EDT 2014
2014-03-28 7:53 GMT-03:00 Walter Bender <walter.bender at gmail.com>:
> Sorry for chiming in late. I was indespoised yesterday.
>
> I think there is no harm in gathering the data as a series. If we have
> missing elements due to crashes, etc., it is still better than
> nothing. Originally, I was thinking of adding something in the same
> place where we trigger write_file so that we accumulated data each
> time the activity was in the background or closed (a bit more robust)
> but honestly, I don't think it really matters so much).
I was thinking about that too: another option is to connect to the
window 'active' property [1] to count only the time the user is
actually using the activity. And not count when she/he goes for a
moment to the Network view or to the Journal, for example.
[1] https://developer.gnome.org/gtk3/stable/GtkWindow.html#GtkWindow--is-active
> On Thu, Mar 27, 2014 at 4:02 PM, Gonzalo Odiard <godiard at sugarlabs.org> wrote:
>>
>>
>>
>> On Thu, Mar 27, 2014 at 4:17 PM, Manuel Quiñones <manuq at laptop.org> wrote:
>>>
>>> 2014-03-27 15:23 GMT-03:00 Gonzalo Odiard <godiard at sugarlabs.org>:
>>> > Maybe have sense save the spent time as a list too,
>>> > like we do with launch times.
>>> > Looks like a non invasive change, and a good source of information.
>>>
>>> Good point, is the other option I was handling. Is a trivial patch too:
>>>
>>> https://github.com/manuq/sugar-toolkit-gtk3/pull/8/files
>>>
>>> I think this one is definetely better.
>>>
>>> I was in doubt for two reasons: 1. because unlike launch_time, this
>>> spent-times metadata will not be saved if the activity does not end
>>> properly: could be a crash, a programming error, end of battery, etc.
>>> So the item N of spent-times will not necessarily correspont to item N
>>> of launch-times.
>>>
>>
>> While is true you don't have how much time was spent in every session,
>> the sequence is good data anyway.
>>
>>>
>>> And secondly, because the simpler option satisfies the placeholder
>>> that is currently in Harvest
>>>
>>> https://github.com/tchx84/harvest-server/blob/master/sql/001-harvest.sql#L24
>>>
>>> The second one will require a new table in Harvest. But that's an
>>> easy change too.
>>
>>
>> Ok, would be good have tch involved then.
>>
>>>
>>>
>>> Side note: I see we have a horrible mix of styles in metadata, some
>>> names use underscore (title_set_by_user, activity_id) and some use
>>> minus character (share-scope, icon-color, launch-times). Does anyone
>>> know the preferred style?
>>>
>>
>> No idea about that
>
> This has always bothered me, but I am not sure how we address it
> without breaking lots of code.
Yeah, but I think we should decide what to do or recommend from now on
for the toolkit keywords. Activities are able to do whatever they
want, of course.
>>
>> Gonzalo
>
> -walter
>
> --
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
--
.. manuq ..
More information about the Sugar-devel
mailing list