Snowflake User Count

Hey,

I have two questions:

  1. I installed Snowflake Proxy Addon in Firefox; is it by design that the user count resets after i close the Browser?

  2. I also started running a snowflake standalone proxy. Is there any way to get the average / total user count to date / last 3 days / today…?

Thanks.

1 Like

Not by design per se, but yes, this is expected. Because currently the user count is only stored in RAM, not on the disk.
In addition, this shows you the number of users in the last 24 hours, not all-time.

Yes, this information can be extracted from the logs.

2 Likes

Ok, thanks!

Can you recommend something so that I can get the user count in an elegant manner? Is there some tool or script that could help me to get the 1h, 1d, alltime? (Based on my understanding the snowflake proxy services only prints it out every 1h and you can change this to one specific interval.

1 Like

Since the proxy log file is plain text it’s fairly easy to parse with standard Unix/Linux tools; here’s a mawk script that outputs the daily connection counts and running total:

#! /usr/bin/mawk -Wi,e
# spdc.awk - snowflake proxy daily conn. counts; assumes
#            std proxy data pulled from ../snowflake.log
#
BEGIN { TODAY = strftime ("%Y/%m/%d", systime(), UTC=1)
	printf "\nsnowflake hourly connection counts for: %s\n\n", TODAY
}
($1 == TODAY && NF > 8) {
	printf " @ %.5s UTC: %3d %s %s\n", $2, $9, $10, $11
	CNT+=$9
}
END { printf "\n total: %d\n\n", CNT }

An example run:

$ ./spdc.awk /var/log/snowflake.log

snowflake hourly connection counts for: 2024/05/31

 @ 15:13 UTC:  39 completed connections.
 @ 16:13 UTC:  66 completed connections.
 @ 17:13 UTC:  45 completed connections.
 @ 18:13 UTC:  72 completed connections.
 @ 19:13 UTC:  63 completed connections.
 @ 20:13 UTC:  76 completed connections.
 @ 21:13 UTC:  40 completed connections.
 @ 22:13 UTC:  34 completed connections.

 total: 435

Script makes use of mawk’s time functions; plain awk doesn’t have those so you would have to improvise by either passing TODAY as a variable or using getline().

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.