summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.h
blob: c4f20bc3cefd312c11009a846bd18e77c9361e8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <cstdint>

struct FastS_QueryPerf
{
    uint32_t queueLen;
    uint32_t activeCnt;
    uint32_t queryCnt;
    double   queryTime;
    uint32_t dropCnt;
    uint32_t timeoutCnt;

    FastS_QueryPerf();

    /**
     * reset all values except the cached 'old' values. This will
     * prepare the object for reuse logging wise.
     **/
    void reset();
    void log();

private:
    uint32_t _lastQueryCnt;
    double   _lastQueryTime;
};