Currently, node accesses are tallied in {node_counter} and all hits globalized in {accesslog}. However, modules building pages that are not nodes (like a dynamic graph) might want to have its access count tallied too.

Therefore a useful feature would be for statistics.module to include an API for modules to register hits so that they could be tallied and displayed later on just like node accesses.

Regarding storage, various scenarios come to mind, but the simplest seems to be adding a type column to node_counter in order to separately log actual nids for nodes, and virtual nids for module-generated pages. The URL-to-virtual-node mapping could be implemented by modules, or they could just pass the path to statistics.module so it would hash the path to a nid and back.

Comments

Status:Active» Postponed

Moving feature requests to latest version and marking as postponed. Seems like it could be a good idea, but it needs some code.

Title:counters for non-nodesAdd a general counter API
Version:5.x-dev» 7.x-dev

Version:7.x-dev» 8.x-dev
Status:Postponed» Active

Not in D7 and we're past freeze. Bumping to D8.

Subscribe. I'll probably regret doing so later, though.

Seems like this would be useful, especially as there's a movement afoot for node.module to not be required in D8. Also, with the introduction of entities, it probably makes more sense to have a counter table rather than node_counter. I'll try and get started on a patch this weekend.

...and virtual nids for module-generated pages

The concept of virtual nids kind of scares me. I wonder if we can use path as the uuid?

Suppose this could be done as part of #1202336: Add a key/value store API