GithubHelp home page GithubHelp logo

ubports / libusermetrics Goto Github PK

View Code? Open in Web Editor NEW
1.0 9.0 0.0 1.41 MB

Moved to https://gitlab.com/ubports/core/libusermetrics

Home Page: https://gitlab.com/ubports/core/libusermetrics

License: GNU General Public License v3.0

CMake 4.77% Shell 0.39% C++ 93.41% QML 1.43%

libusermetrics's Introduction

Welcome to Libusermetrics

Libusermetrics enables apps to locally store interesting numerical data for later presentation. For example in the Ubuntu Greeter "flower" infographic.

  • All data is stored locally in /var/usermetrics/.
  • No data is centrally collected via a web-serivice or otherwise, and no data is sent over the internet.

The only data that can be stored is numerical, for example "number of e-mails" or "number of pictures taken". No personally identifying information is stored using this library.

WARNING: This API should be considered private, and is only for use by first party applications at present. It may change or be removed at any time.

Getting and installing libusermetrics

Using pre-built packages

If you just want to try out libusermetrics, or write user metrics sources, then the easiest way is to use the pre-built packages.

Building and installing from source

If you are curious about libusermetrics's internals or intend to contribute to it, you should get the source and build it.

Getting involved

The best place to ask questions and discuss about libusermetrics is the #ubuntu-touch IRC channel on freenode.

The libusermetrics project is hosted on Launchpad: https://launchpad.net/libusermetrics

Please file bug reports at: http://bugs.launchpad.net/libusermetrics

Writing metric data sources

  • \ref UserMetricsInput "Libusermetrics Input API Documentation"

For simple metrics which only want to increment a counter, see the following examples:

  • \subpage MetricManagerIncrementToday.cpp "MetricManagerIncrementToday.cpp: A simple Qt-based metric"
  • \subpage MetricManagerIncrementTodayCAPI.c "MetricManagerIncrementTodayCAPI.c: A simple C-based metric"

For simple metrics which only want to update today's value, but cannot simply increment it, see the following examples:

  • \subpage MetricManagerUpdateToday.cpp "MetricManagerUpdateToday.cpp: A simple Qt-based metric"
  • \subpage MetricManagerUpdateTodayCAPI.c "MetricManagerUpdateTodayCAPI.c: A simple C-based metric"

For more sophisticated metrics, which wish to update the history of the metric, for example if the user has been offline for a week. Please see the following examples:

  • \subpage MetricManagerAdvanced.cpp "MetricManagerAdvanced.cpp: A Qt-based metric"
  • \subpage MetricManagerAdvancedCAPI.c "MetricManagerAdvancedCAPI.c: A C-based metric"

Writing a presentation application

To write a metric presentation application, there is a Qt API.

  • \ref UserMetricsOutput "Libusermetrics Output API Documentation"
  • A good example to refer to is the infographics for the Unity8 greeter.

libusermetrics's People

Contributors

pete-woods avatar mikix avatar didrocks avatar vanyasem avatar mariogrip avatar dobey avatar z3ntu avatar

Stargazers

Alexey Ugnichev avatar

Watchers

Ricardo Mendoza avatar James Cloos avatar  avatar Dan Chapman avatar  avatar Joan CiberSheep avatar Flo Lee avatar Ubports yumi bot avatar  avatar

libusermetrics's Issues

Localization issues

There are several issues related to translations:

  • i18n.tag seems to be ignored

    • Check CMake renders --keyword=tag and --keyword=tag:1c,2
    • Use Clock app for example
    • Strings gets into the pot file but not translated in the Infographics
    • Workaround: use i18n.tr() intead
  • i18n.tag doesn't support plural forms

    • All strings are 'X strings', which is always plural
    • See Music app

-pthread flag missing

Building bionic branch on Arch GNU/Linux

/usr/bin/ld: ../../libGMock.a(gmock-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
/usr/lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/unit/libusermetricsoutput/CMakeFiles/usermetricsoutput-unit-tests.dir/build.make:202: tests/unit/libusermetricsoutput/usermetricsoutput-unit-tests] Error 1

-pthread is missing in target_link_libraries in CMakeLists.txt

Same as ubports/url-dispatcher#4

QAbstractItemModel::setRoleNames is deprecated

/home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp: In constructor ‘QVariantListModel::QVariantListModel(QObject*)’:
/home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp:92:23: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations]
   92 |     setRoleNames(roles);
      |                       ^
In file included from /usr/include/qt/QtCore/QAbstractListModel:1,
                 from /home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.h:45,
                 from /home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp:51:
/usr/include/qt/QtCore/qabstractitemmodel.h:352:24: note: declared here
  352 |     QT_DEPRECATED void setRoleNames(const QHash<int,QByteArray> &theRoleNames)
      |                        ^~~~~~~~~~~~
/home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp: In constructor ‘QVariantListModel::QVariantListModel(const QVariantList&, QObject*)’:
/home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp:105:23: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations]
  105 |     setRoleNames(roles);
      |                       ^
In file included from /usr/include/qt/QtCore/QAbstractListModel:1,
                 from /home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.h:45,
                 from /home/luca/dev/postmarketOS/unity8-stuff/libusermetrics/src/libusermetricsoutput/qvariantlistmodel.cpp:51:
/usr/include/qt/QtCore/qabstractitemmodel.h:352:24: note: declared here
  352 |     QT_DEPRECATED void setRoleNames(const QHash<int,QByteArray> &theRoleNames)
      |                        ^~~~~~~~~~~~

Docs: https://doc.qt.io/qt-5/qabstractitemmodel-obsolete.html#setRoleNames

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.