SQL select question for hourly data
I will call creationtimestamp simply ts...

SELECT  FLOOR(UNIX_TIMESTAMP(ts)/3600) AS start_of_hour,
        COUNT(*)
    FROM session ...
    GROUP BY FLOOR(UNIX_TIMESTAMP(ts)/3600);


If you need to "pivot" the output into 24 columns, then generate the code from http://mysql.rjweb.org/doc.php/pivot .