Simple way to programmatically get stats from running instance? #112
-
I'd like to query my running instance and get information list that which is displayed in the statistic web interface. The goal is to make an alert for times where tropospheric propagation is ongoing (where my AIS captures move from an average of 9 miles to 20 miles or more (has 113 mile captures 2 weeks ago during a period of heavy tropospheric propagation!) I'd rather not capture ever packet and store info / do math, if possible. Thoughts on the best way to approach this? Reading the stats.bin file? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi Jeff, Do you have the webserver functionality running? That produces JSON files that are shown by the web interface and can be easily downloaded. For example the STAT page has the content from stat.json, which can be retreived in Linux like:
and the ships (with their distance):
Here raspberrypi:8100 is the address of my web interface. You can also in your browser go to: raspberrypi:8100/ships.json Is that what you are after? |
Beta Was this translation helpful? Give feedback.
-
Hi Jeff,
Great idea but you need a more sophisticated algorithm than an average. For example, in my area there are many vessels within 5 miles. If a few distant ones are received under unusual atmospheric conditions, it will barely cause a blip on the average and would probably be in a normal noise level.
One option would be to sort vessels in bins by distance, maybe bins of 5-10, 10-20 miles etc. The bins don’t have to be consistent intervals. You also might want a bin to capture bad gps records, say > 500 miles.
Then you count the number of records in each bin, and create an alert based on some condition. It would take some testing to implement a universal rule, since every station location is going to have very different distributions.
I’m sure there are better algorithms but I’m caffeine deficient right now.
…Tom Kreyche
From: Jeff Luszcz ***@***.***>
Sent: Wednesday, May 24, 2023 8:29 AM
To: jvde-github/AIS-catcher ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [jvde-github/AIS-catcher] Simple way to programmatically get stats from running instance? (Discussion #112)
I'd like to query my running instance and get information list that which is displayed in the statistic web interface.
Primarily I'd like to get the current Max distance seen and max messages per hour.
The goal is to make an alert for times where tropospheric propagation is ongoing (where my AIS captures move from an average of 9 miles to 20 miles or more (has 113 mile captures 2 weeks ago during a period of heavy tropospheric propagation!)
I'd rather not capture ever packet and store info / do math, if possible.
I'm running A/is-catcher as a service using ABCDE's great scripts.
Thoughts on the best way to approach this?
Reading the stats.bin file?
Other API?
—
Reply to this email directly, view it on GitHub <#112> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACVJV7VFL654ZVLODRJ5JXLXHYSLZANCNFSM6AAAAAAYNR4G3M> .
You are receiving this because you are subscribed to this thread. <https://github.com/notifications/beacon/ACVJV7SIOACUGK5EFATXV5DXHYSLZA5CNFSM6AAAAAAYNR4G3OWGG33NNVSW45C7OR4XAZNKIRUXGY3VONZWS33OVJRW63LNMVXHIX3JMTHAAT6KVY.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
For completeness :-) the input for the graphs tab is in:
|
Beta Was this translation helpful? Give feedback.
-
Thank so much. Basically if I see AIS reports more than 10 (or 20 or 30) miles from my station, this indicates possible Tropospheric Ducting, a time where your radio signal might go much further than usual. I'll check every 15 minutes and send an alert if my received signals are further than a specified distance. Code repository here: Mastodon bot account here: Thanks again for the help! |
Beta Was this translation helpful? Give feedback.
Hi Jeff,
Do you have the webserver functionality running? That produces JSON files that are shown by the web interface and can be easily downloaded.
For example the STAT page has the content from stat.json, which can be retreived in Linux like:
and the ships (with their distance):
Here raspberrypi:8100 is the address of my web interface.
You can also in your browser go to: raspberrypi:8100/ships.json
Is that what you are after?