blob: 16a4357d9f8e60a6e6e461d67b860bd761968ca6 (
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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "attribute_usage_sampler_context.h"
#include "attribute_usage_filter.h"
namespace proton {
AttributeUsageSamplerContext::AttributeUsageSamplerContext(AttributeUsageFilter& filter)
: _usage(),
_lock(),
_filter(filter)
{
}
AttributeUsageSamplerContext::~AttributeUsageSamplerContext()
{
_filter.setAttributeStats(_usage);
}
void
AttributeUsageSamplerContext::merge(const search::AddressSpaceUsage &usage,
const vespalib::string &attributeName,
const vespalib::string &subDbName)
{
Guard guard(_lock);
_usage.merge(usage, attributeName, subDbName);
}
}
|