Add IP information API with background WHOIS fetcher
- Add /ip and /ip/{addr} JSON endpoints returning comprehensive IP info
- Include ASN, netblock, country code, org name, abuse contact, RIR data
- Extend ASN schema with WHOIS fields (country, org, abuse contact, etc)
- Create background WHOIS fetcher for rate-limited ASN info updates
- Store raw WHOIS responses for debugging and data preservation
- Queue on-demand WHOIS lookups when stale data is requested
- Refactor handleIPInfo to serve all IP endpoints consistently
This commit is contained in:
@@ -102,14 +102,14 @@ func (t *Tracker) GetStreamMetrics() StreamMetrics {
|
||||
}
|
||||
|
||||
return StreamMetrics{
|
||||
TotalMessages: totalMessages,
|
||||
TotalBytes: totalBytes,
|
||||
TotalWireBytes: totalWireBytes,
|
||||
ConnectedSince: connectedSince,
|
||||
Connected: t.isConnected.Load(),
|
||||
MessagesPerSec: t.messageRate.Rate1(),
|
||||
BitsPerSec: t.byteRate.Rate1() * bitsPerByte,
|
||||
WireBitsPerSec: t.wireByteRate.Rate1() * bitsPerByte,
|
||||
TotalMessages: totalMessages,
|
||||
TotalBytes: totalBytes,
|
||||
TotalWireBytes: totalWireBytes,
|
||||
ConnectedSince: connectedSince,
|
||||
Connected: t.isConnected.Load(),
|
||||
MessagesPerSec: t.messageRate.Rate1(),
|
||||
BitsPerSec: t.byteRate.Rate1() * bitsPerByte,
|
||||
WireBitsPerSec: t.wireByteRate.Rate1() * bitsPerByte,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user