ftw.contentstats


Nameftw.contentstats JSON
Version 1.4.1 PyPI version JSON
download
home_pagehttps://github.com/4teamwork/ftw.contentstats
SummaryCollect and display content statistics for Plone sites
upload_time2024-08-22 08:45:02
maintainerNone
docs_urlNone
author4teamwork AG
requires_pythonNone
licenseGPL2
keywords ftw content stats statistics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
ftw.contentstats
================

.. contents:: Table of Contents


Introduction
============

``ftw.contentstats`` is a Plone add-on for collecting and displaying content
statistics.


Compatibility
-------------

Plone 4.3.x


Installation
============

- Add the package to your buildout configuration:

::

    [instance]
    eggs +=
        ...
        ftw.contentstats


Usage
=====

Visit the ``@@content-stats`` view on a Plone site (requires the
``cmf.ManagePortal`` permission by default).

----

.. image:: https://raw.githubusercontent.com/4teamwork/ftw.contentstats/master/docs/content-stats-view.png


Collected stats
===============

Out of the box, ``ftw.contentstats`` will collect statistics for

- **Types** (distinct ``portal_type``'s and their counts)
- **Workflow states** (distinct ``review_state``'s and their counts)
- **Disk Usage** (total disk usage of the deployment directory, filestorage and blobstorage)

Add-on packages can have additional statistics collected by providing an
``IStatsProvider`` adapter (see interface description for details).

If ``ftw.monitor`` is installed, its performance metrics will also be
included, grouped by instance.


Logging content stats over time
===============================

In order to log content stats to a file, you can use the provided
``bin/dump-content-stats`` script to have stats dumped to a logfile that
contains on JSON entry per line, containing the raw stats for that time.

Usage:

``bin/dump-content-stats -s <plone_site_id>``

The script will cause the stats to be dumped by making a request to the
``@@dump-content-stats`` view. This view is accessible to Anonymous
(``zope.Public``), but *only* when requested from localhost!

So in order for this script to work, you'll have to invoke it on the same
machine where your Zope instances run, and make sure the Plone site is **up
and running**, and reachable from localhost.

The logfile location will be in the same directory as the Z2 log, and the
log will be named ``contentstats-json.log``.

**Note**: In order to figure out the appropriate log directory,
``ftw.contentstats`` needs to derive this information from the eventlog
location. It's therefore important to have an eventlog configured, otherwise
``ftw.contentstats`` will not be able to log any content stats, and complain
noisily through the root logger.

Logging to Fluentd
------------------

Instead of logging to a logfile, ``ftw.contentstats`` can also be configured
to log to a Fluentd instance.

If the environment variable ``FLUENT_HOST`` is set, it will log to that fluent
host using the Fluentd Forward Protocol, instead of logging to a local file.
``FLUENT_PORT`` (optional) allows to specify the port, and defaults to 24224
if not set.

In order for ftw.contentstats to use a proper tag for events logged to Fluentd,
the Pod namespace needs to be exposed in the ``KUBERNETES_NAMESPACE`` env var.


Development
===========

1. Fork this repo
2. Clone your fork
3. Shell: ``ln -s development.cfg buildout.cfg``
4. Shell: ``python boostrap.py``
5. Shell: ``bin/buildout``

Run ``bin/test`` to test your changes.

Or start an instance by running ``bin/instance fg``.


Links
=====

- Github: https://github.com/4teamwork/ftw.contentstats
- Issues: https://github.com/4teamwork/ftw.contentstats/issues
- Pypi: http://pypi.python.org/pypi/ftw.contentstats


Copyright
=========

This package is copyright by `4teamwork <http://www.4teamwork.ch/>`_.

``ftw.contentstats`` is licensed under GNU General Public License, version 2.

Changelog
=========


1.4.1 (2024-08-22)
------------------

- Fix passing args to console command which was broken in 1.4.0. [buchi]


1.4.0 (2024-04-04)
------------------

- Add Python implementation for calculating disk usage. [buchi]

- Add option to specify data path for disk usage calculation. [buchi]

- Add zopectl command for dumping content stats. [buchi]

- Make filestorage (Data.fs) and blobstorage path for disk usage configurable. [buchi]


1.3.0 (2023-04-04)
------------------

- Add support for logging to Fluentd. [lgraf]


1.2.0 (2020-05-04)
------------------

- Add perf_metrics provider that gathers performance metrics from ftw.monitor. [lgraf]


1.1.1 (2018-12-28)
------------------

- Fixed test temp file isolation issues. [Rotonen]


1.1.0 (2018-11-05)
------------------

- Include disk usage (Data.fs and blobstorage) in stats. [lgraf]

- Add Plone 5 compatibility. [phgross]

1.0.3 (2017-09-08)
------------------

- Make determining buildout path independent of working directory.
  [lgraf]


1.0.2 (2017-09-04)
------------------

- Properly build ++resource++ URLs by prefixing them with portal_url instead
  of just a slash. [lgraf]


1.0.1 (2017-09-04)
------------------

- Fail gracefully if eventlog config can't be found in order to derive
  log location from it. Instead of potentially preventing instance startup,
  log a noticeable error message using the root logger.
  [lgraf]


1.0.0 (2017-09-03)
------------------

- Introduce IStatsCollector component and implement portal_types collector. [mathias.leimgruber]

- Rework ContenStats integration. Move "getting the content stats" from the view
  to it's own module/class.
  [mathias.leimgruber]

- Initial implementation.
  [lgraf]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/4teamwork/ftw.contentstats",
    "name": "ftw.contentstats",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "ftw content stats statistics",
    "author": "4teamwork AG",
    "author_email": "mailto:info@4teamwork.ch",
    "download_url": "https://files.pythonhosted.org/packages/c7/57/f41c8c769b31ae31acbe8cf334b14018c2012a24567b090190d28e1be36a/ftw.contentstats-1.4.1.tar.gz",
    "platform": null,
    "description": "================\nftw.contentstats\n================\n\n.. contents:: Table of Contents\n\n\nIntroduction\n============\n\n``ftw.contentstats`` is a Plone add-on for collecting and displaying content\nstatistics.\n\n\nCompatibility\n-------------\n\nPlone 4.3.x\n\n\nInstallation\n============\n\n- Add the package to your buildout configuration:\n\n::\n\n    [instance]\n    eggs +=\n        ...\n        ftw.contentstats\n\n\nUsage\n=====\n\nVisit the ``@@content-stats`` view on a Plone site (requires the\n``cmf.ManagePortal`` permission by default).\n\n----\n\n.. image:: https://raw.githubusercontent.com/4teamwork/ftw.contentstats/master/docs/content-stats-view.png\n\n\nCollected stats\n===============\n\nOut of the box, ``ftw.contentstats`` will collect statistics for\n\n- **Types** (distinct ``portal_type``'s and their counts)\n- **Workflow states** (distinct ``review_state``'s and their counts)\n- **Disk Usage** (total disk usage of the deployment directory, filestorage and blobstorage)\n\nAdd-on packages can have additional statistics collected by providing an\n``IStatsProvider`` adapter (see interface description for details).\n\nIf ``ftw.monitor`` is installed, its performance metrics will also be\nincluded, grouped by instance.\n\n\nLogging content stats over time\n===============================\n\nIn order to log content stats to a file, you can use the provided\n``bin/dump-content-stats`` script to have stats dumped to a logfile that\ncontains on JSON entry per line, containing the raw stats for that time.\n\nUsage:\n\n``bin/dump-content-stats -s <plone_site_id>``\n\nThe script will cause the stats to be dumped by making a request to the\n``@@dump-content-stats`` view. This view is accessible to Anonymous\n(``zope.Public``), but *only* when requested from localhost!\n\nSo in order for this script to work, you'll have to invoke it on the same\nmachine where your Zope instances run, and make sure the Plone site is **up\nand running**, and reachable from localhost.\n\nThe logfile location will be in the same directory as the Z2 log, and the\nlog will be named ``contentstats-json.log``.\n\n**Note**: In order to figure out the appropriate log directory,\n``ftw.contentstats`` needs to derive this information from the eventlog\nlocation. It's therefore important to have an eventlog configured, otherwise\n``ftw.contentstats`` will not be able to log any content stats, and complain\nnoisily through the root logger.\n\nLogging to Fluentd\n------------------\n\nInstead of logging to a logfile, ``ftw.contentstats`` can also be configured\nto log to a Fluentd instance.\n\nIf the environment variable ``FLUENT_HOST`` is set, it will log to that fluent\nhost using the Fluentd Forward Protocol, instead of logging to a local file.\n``FLUENT_PORT`` (optional) allows to specify the port, and defaults to 24224\nif not set.\n\nIn order for ftw.contentstats to use a proper tag for events logged to Fluentd,\nthe Pod namespace needs to be exposed in the ``KUBERNETES_NAMESPACE`` env var.\n\n\nDevelopment\n===========\n\n1. Fork this repo\n2. Clone your fork\n3. Shell: ``ln -s development.cfg buildout.cfg``\n4. Shell: ``python boostrap.py``\n5. Shell: ``bin/buildout``\n\nRun ``bin/test`` to test your changes.\n\nOr start an instance by running ``bin/instance fg``.\n\n\nLinks\n=====\n\n- Github: https://github.com/4teamwork/ftw.contentstats\n- Issues: https://github.com/4teamwork/ftw.contentstats/issues\n- Pypi: http://pypi.python.org/pypi/ftw.contentstats\n\n\nCopyright\n=========\n\nThis package is copyright by `4teamwork <http://www.4teamwork.ch/>`_.\n\n``ftw.contentstats`` is licensed under GNU General Public License, version 2.\n\nChangelog\n=========\n\n\n1.4.1 (2024-08-22)\n------------------\n\n- Fix passing args to console command which was broken in 1.4.0. [buchi]\n\n\n1.4.0 (2024-04-04)\n------------------\n\n- Add Python implementation for calculating disk usage. [buchi]\n\n- Add option to specify data path for disk usage calculation. [buchi]\n\n- Add zopectl command for dumping content stats. [buchi]\n\n- Make filestorage (Data.fs) and blobstorage path for disk usage configurable. [buchi]\n\n\n1.3.0 (2023-04-04)\n------------------\n\n- Add support for logging to Fluentd. [lgraf]\n\n\n1.2.0 (2020-05-04)\n------------------\n\n- Add perf_metrics provider that gathers performance metrics from ftw.monitor. [lgraf]\n\n\n1.1.1 (2018-12-28)\n------------------\n\n- Fixed test temp file isolation issues. [Rotonen]\n\n\n1.1.0 (2018-11-05)\n------------------\n\n- Include disk usage (Data.fs and blobstorage) in stats. [lgraf]\n\n- Add Plone 5 compatibility. [phgross]\n\n1.0.3 (2017-09-08)\n------------------\n\n- Make determining buildout path independent of working directory.\n  [lgraf]\n\n\n1.0.2 (2017-09-04)\n------------------\n\n- Properly build ++resource++ URLs by prefixing them with portal_url instead\n  of just a slash. [lgraf]\n\n\n1.0.1 (2017-09-04)\n------------------\n\n- Fail gracefully if eventlog config can't be found in order to derive\n  log location from it. Instead of potentially preventing instance startup,\n  log a noticeable error message using the root logger.\n  [lgraf]\n\n\n1.0.0 (2017-09-03)\n------------------\n\n- Introduce IStatsCollector component and implement portal_types collector. [mathias.leimgruber]\n\n- Rework ContenStats integration. Move \"getting the content stats\" from the view\n  to it's own module/class.\n  [mathias.leimgruber]\n\n- Initial implementation.\n  [lgraf]\n",
    "bugtrack_url": null,
    "license": "GPL2",
    "summary": "Collect and display content statistics for Plone sites",
    "version": "1.4.1",
    "project_urls": {
        "Homepage": "https://github.com/4teamwork/ftw.contentstats"
    },
    "split_keywords": [
        "ftw",
        "content",
        "stats",
        "statistics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c757f41c8c769b31ae31acbe8cf334b14018c2012a24567b090190d28e1be36a",
                "md5": "fa7c76b29dfccac8c9a370025134f474",
                "sha256": "f6680308d6b4e4dd200ab899425322f2dd807557486feadb5dcd633d401be0ef"
            },
            "downloads": -1,
            "filename": "ftw.contentstats-1.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fa7c76b29dfccac8c9a370025134f474",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 177173,
            "upload_time": "2024-08-22T08:45:02",
            "upload_time_iso_8601": "2024-08-22T08:45:02.659407Z",
            "url": "https://files.pythonhosted.org/packages/c7/57/f41c8c769b31ae31acbe8cf334b14018c2012a24567b090190d28e1be36a/ftw.contentstats-1.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 08:45:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "4teamwork",
    "github_project": "ftw.contentstats",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ftw.contentstats"
}
        
Elapsed time: 0.30075s