aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/common/eventlogger.h
blob: 9be75eb780c19c78c3d0bd046d39f27c9b73f84e (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/searchlib/common/serialnum.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/util/time.h>
#include <vector>

namespace proton {

/**
 * Class used to log various events.
 **/
class EventLogger {
private:
    using SerialNum = search::SerialNum;
    using string = vespalib::string;
public:
    static void transactionLogReplayComplete(const string &domainName, vespalib::duration elapsedTime);
    static void populateAttributeStart(const std::vector<string> &names);
    static void populateAttributeComplete(const std::vector<string> &names, int64_t documentsVisisted);
    static void populateDocumentFieldStart(const string &fieldName);
    static void populateDocumentFieldComplete(const string &fieldName, int64_t documentsVisisted);
    static void lidSpaceCompactionComplete(const string &subDbName, uint32_t lidLimit);
    static void reprocessDocumentsStart(const string &subDb, double visitCost);
    static void reprocessDocumentsProgress(const string &subDb, double progress, double visitCost);
    static void reprocessDocumentsComplete(const string &subDb, double visitCost, vespalib::duration elapsedTime);
    static void transactionLogReplayStart(const string &domainName,
                                          SerialNum first,
                                          SerialNum last);
    static void transactionLogReplayProgress(const string &domainName,
                                             float progress,
                                             SerialNum first,
                                             SerialNum last,
                                             SerialNum current);
    static void flushInit(const string &name);
    static void flushStart(const string &name,
                           int64_t beforeMemory,
                           int64_t afterMemory,
                           int64_t toFreeMemory,
                           SerialNum unflushed,
                           SerialNum current);
    static void flushComplete(const string &name,
                              vespalib::duration elapsedTime,
                              SerialNum flushed,
                              const string &outputPath,
                              size_t outputPathElems);
    static void flushPrune(const string &name, SerialNum oldestFlushed);
    static void loadAttributeStart(const vespalib::string &subDbName, const vespalib::string &attrName);
    static void loadAttributeComplete(const vespalib::string &subDbName,
                                      const vespalib::string &attrName, vespalib::duration elapsedTime);
    static void loadDocumentMetaStoreStart(const vespalib::string &subDbName);
    static void loadDocumentMetaStoreComplete(const vespalib::string &subDbName, vespalib::duration elapsedTime);
    static void loadDocumentStoreStart(const vespalib::string &subDbName);
    static void loadDocumentStoreComplete(const vespalib::string &subDbName, vespalib::duration elapsedTime);
    static void transactionLogPruneComplete(const string &domainName, SerialNum prunedSerial);
};

} // namespace proton