No internet connection
  1. Home
  2. Ideas

Ability to show basic statistics as a function of time

By Christian Scheuer @chrscheuer
    2026-02-10 05:02:12.761Z

    We'd love to be able to render a few graphs to understand forum usage over time (maybe eventually they could live in the Admin dashboard).

    This helps understand patterns our team experiences, such as "there appears to be more users reporting XXX".

    As a starting point, it'd be great to have some example SQL statements we could run to extract this type of data and visualize it ourselves.

    • Number of new posts per day
    • Number of new threads (pages) per day

    And then get a table with the day and the number aggregated. We could then always feed this to various graphics engines for the visualization.

    Solved in post #2, click to view
    • 3 replies
    1. KajMagnus @KajMagnus2026-02-16 06:22:27.504Z2026-02-16 06:36:24.001Z

      Yes this'd be nice. Here's the new-comments-per-day, and new-pages-per-day:

      (Let me know if you want more SQL for sth else.   & Sorry for the a bit late reply.)

      select
          date_trunc('day', p.created_at) as date_trunk_day,
          count(case when p.post_nr > 1 then 1 end) new_comments,
          count(case when p.post_nr = 1 then 1 end) new_pages,
          s.id site_id,
          h.host
      from posts3 p  -- will be renamed to posts_t some day
          inner join sites3 s on p.site_id = s.id
          inner join hosts3 h on h.site_id = s.id and h.canonical = 'C'
      where
          h.host not like 'test-%'
          and p.post_nr >= 1  -- ignore title (nr 0) and special posts, e.g. bookmarks (nr < 0)
      group by
          date_trunk_day, s.id, h.host
      order by
          date_trunk_day desc, s.id
      limit 365;
      

      extract this type of data and visualize it ourselves.

      How would you go about doing that? (For example, how do you "create" an API to get the data out of the database?)

      I did experiment quickly on localhost some time ago with connecting Metabase (I think it was), https://www.metabase.com, directly to a Talkyard database. Was pretty easy to get it working and showing different graphs. However, in your case you'd need some authentication in front of Metabase.

      Edit: There's also Apache Superset, https://superset.apache.org, and Redash, https://redash.io/. (And more ...)

      We could then always feed this to various graphics engines

      It would be interesting to hear about what tools you're using :- )

      Reply1 LikeSolution
      1. CChristian Scheuer @chrscheuer
          2026-02-16 16:44:22.081Z

          Thank you!! Can't wait to try this.

          I would probably just use gcloud ssh into the engine and run a script that then returns the data directly out so I just receive the output in my own CLI and can store here instead of juggling setting up something permanent on the server (I prefer to keep it lean Talkyard).

          Then probably ask AI to build a python script to visualize it, or something like that. We mostly just want this for internal graphs and evaluation, so no need for a big fancy pipeline.

          1. CChristian Scheuer @chrscheuer
              2026-02-16 17:24:13.552Z

              This works beautifully! Thank you Magnus!

          2. Progress
            with doing this idea
          3. @KajMagnus marked this topic as Planned 2026-02-16 06:23:21.559Z.
          4. C@chrscheuer accepted an answer 2026-02-16 17:28:44.533Z.