Documentation ¶
Index ¶
- Constants
- Variables
- func AddRequestMsgMap(clientIP, srvIP string, reqID uint16, questions []mkdns.Question)
- func CalculateAverageTime(clientIp string, responseTime float64)
- func CalculateAverageTimePerView(clientIp string, responseTime float64, metricType string)
- func CalculateRecursiveMsg(clientIP, srvIP string, reqID uint16, questions []mkdns.Question, ...)
- func CreateCounterMetric(srcIp string, dstIp string)
- func CreateCounterMetricPerView(mapViewIPs map[int]map[string][]string)
- func FindClientInView(clientIP string) string
- func GetConfigDNSStatistics()
- func HandleRequestDecodeErr(clientIP, srvIP string)
- func HandleResponseDecodeErr(clientIP, srvIP string, RCodeString string)
- func IncrDNSStatsDuplicated(clientIp string)
- func IncrDNSStatsDuplicatedForPerView(clientIp string)
- func IncrDNSStatsFormatError(clientIp string)
- func IncrDNSStatsFormatErrorForPerView(clientIp string, metricType string)
- func IncrDNSStatsNXDomain(clientIp string)
- func IncrDNSStatsNXDomainForPerView(clientIp string, metricType string)
- func IncrDNSStatsNXRRSet(clientIp string)
- func IncrDNSStatsNXRRSetForPerView(clientIp string, metricType string)
- func IncrDNSStatsOtherRCode(clientIp string)
- func IncrDNSStatsOtherRCodeForPerView(clientIp string, metricType string)
- func IncrDNSStatsRecursive(clientIp string)
- func IncrDNSStatsRecursiveForPerClient(clientIp string)
- func IncrDNSStatsReferral(clientIp string)
- func IncrDNSStatsReferralForPerView(clientIp string, metricType string)
- func IncrDNSStatsRefused(clientIp string)
- func IncrDNSStatsRefusedForPerView(clientIp string, metricType string)
- func IncrDNSStatsServerFail(clientIp string)
- func IncrDNSStatsServerFailForPerView(clientIp string, metricType string)
- func IncrDNSStatsSuccessful(clientIp string)
- func IncrDNSStatsSuccessfulForPerView(clientIp string, metricType string)
- func IncrDNSStatsSuccessfulNoAuthAns(clientIp string)
- func IncrDNSStatsSuccessfulNoAuthAnsForPerView(clientIp string)
- func IncrDNSStatsSuccessfulRecursive(clientIp string)
- func IncrDNSStatsSuccessfulRecursiveForPerView(clientIp string)
- func IncrDNSStatsTotalQueries(clientIp string)
- func IncrDNSStatsTotalQueriesForPerView(clientIp string)
- func IncrDNSStatsTotalResponses(clientIp string)
- func IncreaseQueryCounter(srcIp string, dstIp string, mode string)
- func IncreaseQueryCounterForPerView(srcIp string, dstIp string, mode string)
- func InitStatisticsDNS()
- func Queries(srcIp string, dstIp string)
- func QueriesForPerView(srcIp string)
- func ReceiveHttpRequest(payloadString string)
- func ReceivedMessage(msg *model.Record)
- func Response(srcIp string, dstIp string)
- func ResponseForPerView(dstIp string)
- type DNSMetrics
- type RequestMap
- type StatisticsDNS
- type StatisticsService
Constants ¶
View Source
const ( CLIENT = "perClient" AUTHSERVER = "perServer" VIEW = "perView" NOERROR = "NOERROR" NXDOMAIN = "NXDOMAIN" SERVFAIL = "SERVFAIL" FORMERR = "FORMERR" REFUSED = "REFUSED" RR_NS = "NS" RQ_C_MAP = "Incoming" RQ_S_MAP = "Outgoing" QUERY = "Query" RESPONSE = "Response" RQ_ERR_MAP = "Formerr" )
Variables ¶
View Source
var ( StatSrv *StatisticsService ReqMap *RequestMap StatInterval = time.Duration(30) MaximumClients = 200 IpNetsClient []*net.IPNet IpNetsServer []*net.IPNet IpsClient []string IpsServer []string UrlAnnouncementDeployFromBam string MapViewIPs map[int]map[string][]string )
Functions ¶
func AddRequestMsgMap ¶
Store all request messages into the corresponding map for Incoming messages and Outgoing messages
func CalculateAverageTime ¶
func CalculateRecursiveMsg ¶
func CalculateRecursiveMsg(clientIP, srvIP string, reqID uint16, questions []mkdns.Question, dnsMsg *mkdns.Msg)
Extract the client question from the response and find it from the Outgoing messages Then find client question from the Incoming messages All found the client question, increase the recursive value for the client stat, then remove out the request from the maps
func CreateCounterMetric ¶
Create metric for the Client/AS/Forwarder
func CreateCounterMetricPerView ¶
Create metric for perView
func FindClientInView ¶
func GetConfigDNSStatistics ¶
func GetConfigDNSStatistics()
func HandleRequestDecodeErr ¶
func HandleRequestDecodeErr(clientIP, srvIP string)
func HandleResponseDecodeErr ¶
func IncrDNSStatsDuplicated ¶
func IncrDNSStatsDuplicated(clientIp string)
func IncrDNSStatsDuplicatedForPerView ¶
func IncrDNSStatsDuplicatedForPerView(clientIp string)
func IncrDNSStatsFormatError ¶
func IncrDNSStatsFormatError(clientIp string)
func IncrDNSStatsNXDomain ¶
func IncrDNSStatsNXDomain(clientIp string)
func IncrDNSStatsNXRRSet ¶
func IncrDNSStatsNXRRSet(clientIp string)
func IncrDNSStatsOtherRCode ¶
func IncrDNSStatsOtherRCode(clientIp string)
func IncrDNSStatsRecursive ¶
func IncrDNSStatsRecursive(clientIp string)
func IncrDNSStatsRecursiveForPerClient ¶
func IncrDNSStatsRecursiveForPerClient(clientIp string)
func IncrDNSStatsReferral ¶
func IncrDNSStatsReferral(clientIp string)
func IncrDNSStatsRefused ¶
func IncrDNSStatsRefused(clientIp string)
func IncrDNSStatsServerFail ¶
func IncrDNSStatsServerFail(clientIp string)
func IncrDNSStatsSuccessful ¶
func IncrDNSStatsSuccessful(clientIp string)
func IncrDNSStatsSuccessfulNoAuthAns ¶
func IncrDNSStatsSuccessfulNoAuthAns(clientIp string)
func IncrDNSStatsSuccessfulNoAuthAnsForPerView ¶
func IncrDNSStatsSuccessfulNoAuthAnsForPerView(clientIp string)
func IncrDNSStatsSuccessfulRecursive ¶
func IncrDNSStatsSuccessfulRecursive(clientIp string)
func IncrDNSStatsSuccessfulRecursiveForPerView ¶
func IncrDNSStatsSuccessfulRecursiveForPerView(clientIp string)
func IncrDNSStatsTotalQueries ¶
func IncrDNSStatsTotalQueries(clientIp string)
func IncrDNSStatsTotalQueriesForPerView ¶
func IncrDNSStatsTotalQueriesForPerView(clientIp string)
func IncrDNSStatsTotalResponses ¶
func IncrDNSStatsTotalResponses(clientIp string)
func IncreaseQueryCounter ¶
func InitStatisticsDNS ¶
func InitStatisticsDNS()
func QueriesForPerView ¶
func QueriesForPerView(srcIp string)
func ReceiveHttpRequest ¶
func ReceiveHttpRequest(payloadString string)
func ReceivedMessage ¶
func ResponseForPerView ¶
func ResponseForPerView(dstIp string)
Types ¶
type DNSMetrics ¶
type DNSMetrics struct { TotalQueries int64 `json:"total_queries"` TotalResponses int64 `json:"total_responses"` Recursive int64 `json:"recursive"` SuccessfulRecursive int64 `json:"successful_recursive"` SuccessfulNoAuthAns int64 `json:"successful_noauthans"` Duplicated int64 `json:"duplicated"` AverageTime *float64 `json:"average_time"` Successful int64 `json:"successful"` ServerFail int64 `json:"server_fail"` NXDomain int64 `json:"nx_domain"` FormatError int64 `json:"format_error"` NXRRSet int64 `json:"nx_rrset"` Referral int64 `json:"referral"` Refused int64 `json:"refused"` OtherRcode int64 `json:"other_rcode"` }
Statistics details
type RequestMap ¶
Query map for recursion counting
type StatisticsDNS ¶
type StatisticsDNS struct { Type string `json:"type"` DNSMetrics *DNSMetrics `json:"dnsmetrics"` }
Statistics for a client or an AS.
type StatisticsService ¶
type StatisticsService struct { Start time.Time `json:"start"` End time.Time `json:"end"` StatsMap map[string]*StatisticsDNS `json:"stats_map"` }
Statistics service
Click to show internal directories.
Click to hide internal directories.