mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-02 20:36:37 +00:00
Move the tool as a dependency for static checks migration. Fixes #8187 Signed-off-by: Bin Liu <bin@hyper.sh> Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com> Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com> Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com> Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com> Signed-off-by: Julio Montes <julio.montes@intel.com>
42 lines
652 B
Go
42 lines
652 B
Go
//
|
|
// Copyright (c) 2019 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func (d *Doc) showStats() {
|
|
var counters [LinkTypeCount]int
|
|
|
|
linkCount := 0
|
|
|
|
for _, linkList := range d.Links {
|
|
for _, link := range linkList {
|
|
counters[link.Type]++
|
|
linkCount++
|
|
}
|
|
}
|
|
|
|
fields := logrus.Fields{
|
|
"headings-count": len(d.Headings),
|
|
"links-count": linkCount,
|
|
}
|
|
|
|
for i, count := range counters {
|
|
name := LinkType(i).String()
|
|
|
|
fieldName := fmt.Sprintf("link-type-%s-count", name)
|
|
|
|
fields[fieldName] = count
|
|
}
|
|
|
|
d.Logger.WithFields(fields).Info("Statistics")
|
|
}
|