Reorganize instrument code
This commit is contained in:
parent
8446c116a8
commit
455fb65e77
4 changed files with 22 additions and 18 deletions
|
@ -119,8 +119,13 @@ func (sg StatsGatherer) worker() {
|
|||
section = pattern[1]
|
||||
}
|
||||
|
||||
sg.instrument.Visit(section, id, search, fmt)
|
||||
sg.instrument.Duration(section, search, req.duration)
|
||||
sg.instrument.Request(instrument.RequestData{
|
||||
Section: section,
|
||||
ID: id,
|
||||
Search: search,
|
||||
Fmt: fmt,
|
||||
Duration: req.duration
|
||||
})
|
||||
switch section {
|
||||
case "download":
|
||||
err = sg.db.IncDownloads(id)
|
||||
|
|
Reference in a new issue