Bug 96434 - Activate usage data collection from commandline
Summary: Activate usage data collection from commandline
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.1.0.0.beta1
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: ToBeReviewed
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Commandline Usage-Metrics
  Show dependency treegraph
 
Reported: 2015-12-12 06:08 UTC by Yousuf Philips (jay) (retired)
Modified: 2021-02-04 13:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-12-12 06:08:49 UTC
Activation of usage data is only available from within the options dialog, but there needs to be a means of also session activating it through a commandline switch and/or environment variable in order to deal with various scenarios.

Possible switch: $ ./soffice --usage-stats
Possible env variable: $ export SAL_USAGE_STATS=1
Comment 1 Jan Holesovsky 2015-12-14 20:09:09 UTC
Env. variable would be preferred.  The code where to add it is here:

sfx2/source/control/unoctitm.cxx

and add the getenv checking at the beginning of collectUsageInformation() function.
Comment 2 Dave Richards 2015-12-14 20:21:11 UTC
Sounds great to me, just as easy for me to set.
Comment 3 aybuke 2016-01-14 20:21:52 UTC
Hi everyone,

I added "--usage-dump" in aCmdLineHelp_left array. http://opengrok.libreoffice.org/xref/core/desktop/source/app/cmdlinehelp.cxx#53

When run with this parameter LO, bCollecting must be true, as I understand it.
http://opengrok.libreoffice.org/xref/core/sfx2/source/control/unoctitm.cxx#672

I have to do this, I think:

if (!bCollecting)
    if(use --usage-dump) // Can you give an example of this control?
      bCollecting = true
    else
      return

Am I trying to do the right function?

Thank you.
Comment 4 Jan Holesovsky 2016-01-14 21:46:54 UTC
aybuke: Thank you for working on this!

Please use an environment variable (using getenv()), a command line parameter is an overkill here.

Ie. a code like

static bool bCollecting = getenv("LO_COLLECT_USAGE") != nullptr;

and then initiate the functionality based on that.

Thank you! - glad you are working on this :-)
Comment 5 Commit Notification 2016-01-23 08:36:52 UTC
aybuke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=beea0484de87709da0814b4acd19527c8824f9b3

tdf#96434 Activate usage data collection from commandline.

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Robinson Tryon (qubit) 2016-02-18 14:52:36 UTC Comment hidden (noise)
Comment 7 Timur 2016-03-07 16:00:09 UTC
Is this fixed then?
Comment 8 Yousuf Philips (jay) (retired) 2016-03-07 16:57:23 UTC
I tested it and got the usage stats crash, so it must be functioning.