docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
if clientID != "" {
d.ServerName = clientID + "." + d.ServerName | <mask> // See https://developer.apple.com/documentation/devicemanagement/dnssettings/dnssettings.
<mask> d.ServerName = ""
<mask> case dnsProtoTLS:
<mask> dspName = fmt.Sprintf("%s DoT", d.ServerName)
<mask> if d.clientID != "" {
<mask> d.ServerName = d.clientID + "." + d.ServerName
<mask> }
<mask> default:
<mask> return nil, fmt.Errorf("bad dns protocol %q", proto)
<mask> }
<mask>
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove //
// See https://developer.apple.com/documentation/devicemanagement/dnssettings/dnssettings.
</s> add </s> remove data := mobileConfig{
PayloadContent: []payloadContent{{
Name: dspName,
PayloadDescription: "Configures device to use AdGuard Home",
PayloadDisplayName: dspName,
PayloadIdentifier: fmt.Sprintf("com.apple.dnsSettings.managed.%s", genUUIDv4()),
PayloadType: "com.apple.dnsSettings.managed",
</s> add payloadID := fmt.Sprintf("%s.%s", dnsSettingsPayloadType, genUUIDv4())
data := &mobileConfig{
PayloadDescription: "Adds AdGuard Home to macOS Big Sur " +
"and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
PayloadContent: []*payloadContent{{
PayloadType: dnsSettingsPayloadType,
PayloadIdentifier: payloadID, </s> remove func getMobileConfig(d dnsSettings) ([]byte, error) {
</s> add func encodeMobileConfig(d *dnsSettings, clientID string) ([]byte, error) { </s> remove Path: path.Join("/dns-query", d.clientID),
</s> add Path: path.Join("/dns-query", clientID), </s> remove restartHTTP := true
if config.BindHost.Equal(req.Web.IP) && config.BindPort == req.Web.Port {
// no need to rebind
restartHTTP = false
}
// validate that hosts and ports are bindable
if restartHTTP {
err = aghnet.CheckPortAvailable(req.Web.IP, req.Web.Port)
if err != nil {
httpError(
w,
http.StatusBadRequest,
"can not listen on IP:port %s: %s",
netutil.JoinHostPort(req.Web.IP.String(), req.Web.Port),
err,
)
return
}
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
payloadID := fmt.Sprintf("%s.%s", dnsSettingsPayloadType, genUUIDv4())
data := &mobileConfig{
PayloadDescription: "Adds AdGuard Home to macOS Big Sur " +
"and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
PayloadContent: []*payloadContent{{
PayloadType: dnsSettingsPayloadType,
PayloadIdentifier: payloadID, | <mask> default:
<mask> return nil, fmt.Errorf("bad dns protocol %q", proto)
<mask> }
<mask>
<mask> data := mobileConfig{
<mask> PayloadContent: []payloadContent{{
<mask> Name: dspName,
<mask> PayloadDescription: "Configures device to use AdGuard Home",
<mask> PayloadDisplayName: dspName,
<mask> PayloadIdentifier: fmt.Sprintf("com.apple.dnsSettings.managed.%s", genUUIDv4()),
<mask> PayloadType: "com.apple.dnsSettings.managed",
<mask> PayloadUUID: genUUIDv4(),
<mask> PayloadVersion: 1,
<mask> DNSSettings: d,
<mask> }},
<mask> PayloadDescription: "Adds AdGuard Home to Big Sur and iOS 14 or newer systems",
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove PayloadDescription: "Adds AdGuard Home to Big Sur and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadRemovalDisallowed: false,
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
</s> add </s> remove if d.clientID != "" {
d.ServerName = d.clientID + "." + d.ServerName
</s> add if clientID != "" {
d.ServerName = clientID + "." + d.ServerName </s> remove err = configureOS(&config)
</s> add err = configureOS(config) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
PayloadDisplayName: dspName,
PayloadDescription: "Configures device to use AdGuard Home", | <mask> PayloadContent: []*payloadContent{{
<mask> PayloadType: dnsSettingsPayloadType,
<mask> PayloadIdentifier: payloadID,
<mask> PayloadUUID: genUUIDv4(),
<mask> PayloadVersion: 1,
<mask> DNSSettings: d,
<mask> }},
<mask> PayloadVersion: 1,
<mask> PayloadRemovalDisallowed: false,
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove PayloadDescription: "Adds AdGuard Home to Big Sur and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadRemovalDisallowed: false,
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
</s> add </s> remove data := mobileConfig{
PayloadContent: []payloadContent{{
Name: dspName,
PayloadDescription: "Configures device to use AdGuard Home",
PayloadDisplayName: dspName,
PayloadIdentifier: fmt.Sprintf("com.apple.dnsSettings.managed.%s", genUUIDv4()),
PayloadType: "com.apple.dnsSettings.managed",
</s> add payloadID := fmt.Sprintf("%s.%s", dnsSettingsPayloadType, genUUIDv4())
data := &mobileConfig{
PayloadDescription: "Adds AdGuard Home to macOS Big Sur " +
"and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
PayloadContent: []*payloadContent{{
PayloadType: dnsSettingsPayloadType,
PayloadIdentifier: payloadID, </s> remove assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "cli42.example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
<mask> PayloadUUID: genUUIDv4(),
<mask> PayloadVersion: 1,
<mask> DNSSettings: d,
<mask> }},
<mask> PayloadDescription: "Adds AdGuard Home to Big Sur and iOS 14 or newer systems",
<mask> PayloadDisplayName: dspName,
<mask> PayloadIdentifier: genUUIDv4(),
<mask> PayloadRemovalDisallowed: false,
<mask> PayloadType: "Configuration",
<mask> PayloadUUID: genUUIDv4(),
<mask> PayloadVersion: 1,
<mask> }
<mask>
<mask> return plist.MarshalIndent(data, plist.XMLFormat, "\t")
<mask> }
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove data := mobileConfig{
PayloadContent: []payloadContent{{
Name: dspName,
PayloadDescription: "Configures device to use AdGuard Home",
PayloadDisplayName: dspName,
PayloadIdentifier: fmt.Sprintf("com.apple.dnsSettings.managed.%s", genUUIDv4()),
PayloadType: "com.apple.dnsSettings.managed",
</s> add payloadID := fmt.Sprintf("%s.%s", dnsSettingsPayloadType, genUUIDv4())
data := &mobileConfig{
PayloadDescription: "Adds AdGuard Home to macOS Big Sur " +
"and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
PayloadContent: []*payloadContent{{
PayloadType: dnsSettingsPayloadType,
PayloadIdentifier: payloadID, </s> remove restartHTTP := true
if config.BindHost.Equal(req.Web.IP) && config.BindPort == req.Web.Port {
// no need to rebind
restartHTTP = false
}
// validate that hosts and ports are bindable
if restartHTTP {
err = aghnet.CheckPortAvailable(req.Web.IP, req.Web.Port)
if err != nil {
httpError(
w,
http.StatusBadRequest,
"can not listen on IP:port %s: %s",
netutil.JoinHostPort(req.Web.IP.String(), req.Web.Port),
err,
)
return
}
}
</s> add </s> remove // Duration marshalling and unmarshalling cases.
</s> add // Duration marshalling and unmarshaling cases. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
|
PayloadRemovalDisallowed: false, | <mask> DNSSettings: d,
<mask> }},
<mask> PayloadVersion: 1,
<mask> }
<mask>
<mask> return plist.MarshalIndent(data, plist.XMLFormat, "\t")
<mask> }
<mask>
<mask> func respondJSONError(w http.ResponseWriter, status int, msg string) {
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove PayloadDescription: "Adds AdGuard Home to Big Sur and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadRemovalDisallowed: false,
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
</s> add </s> remove data := mobileConfig{
PayloadContent: []payloadContent{{
Name: dspName,
PayloadDescription: "Configures device to use AdGuard Home",
PayloadDisplayName: dspName,
PayloadIdentifier: fmt.Sprintf("com.apple.dnsSettings.managed.%s", genUUIDv4()),
PayloadType: "com.apple.dnsSettings.managed",
</s> add payloadID := fmt.Sprintf("%s.%s", dnsSettingsPayloadType, genUUIDv4())
data := &mobileConfig{
PayloadDescription: "Adds AdGuard Home to macOS Big Sur " +
"and iOS 14 or newer systems",
PayloadDisplayName: dspName,
PayloadIdentifier: genUUIDv4(),
PayloadType: "Configuration",
PayloadUUID: genUUIDv4(),
PayloadContent: []*payloadContent{{
PayloadType: dnsSettingsPayloadType,
PayloadIdentifier: payloadID, </s> remove httpError(w, http.StatusBadRequest, "Failed to parse 'configure' JSON: %s", err)
return
}
</s> add httpError(w, http.StatusBadRequest, "%s", err) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
d := &dnsSettings{
DNSProtocol: dnsp,
ServerName: host,
ServerAddresses: cloneBootstrap(), | <mask> return
<mask> }
<mask> }
<mask>
<mask> d := dnsSettings{
<mask> DNSProtocol: dnsp,
<mask> ServerName: host,
<mask> clientID: clientID,
<mask> }
<mask>
<mask> mobileconfig, err := getMobileConfig(d)
<mask> if err != nil {
<mask> respondJSONError(w, http.StatusInternalServerError, err.Error())
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove mobileconfig, err := getMobileConfig(d)
</s> add mobileconfig, err := encodeMobileConfig(d, clientID) </s> remove copyInstallSettings(&config, &curConfig)
</s> add copyInstallSettings(config, curConfig) </s> remove copyInstallSettings(&config, &curConfig)
</s> add copyInstallSettings(config, curConfig) </s> remove restartHTTP := true
if config.BindHost.Equal(req.Web.IP) && config.BindPort == req.Web.Port {
// no need to rebind
restartHTTP = false
}
// validate that hosts and ports are bindable
if restartHTTP {
err = aghnet.CheckPortAvailable(req.Web.IP, req.Web.Port)
if err != nil {
httpError(
w,
http.StatusBadRequest,
"can not listen on IP:port %s: %s",
netutil.JoinHostPort(req.Web.IP.String(), req.Web.Port),
err,
)
return
}
}
</s> add </s> remove req := applyConfigReq{}
err := json.NewDecoder(r.Body).Decode(&req)
</s> add req, restartHTTP, err := decodeApplyConfigReq(r.Body) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
mobileconfig, err := encodeMobileConfig(d, clientID) | <mask> ServerName: host,
<mask> clientID: clientID,
<mask> }
<mask>
<mask> mobileconfig, err := getMobileConfig(d)
<mask> if err != nil {
<mask> respondJSONError(w, http.StatusInternalServerError, err.Error())
<mask>
<mask> return
<mask> }
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove d := dnsSettings{
DNSProtocol: dnsp,
ServerName: host,
clientID: clientID,
</s> add d := &dnsSettings{
DNSProtocol: dnsp,
ServerName: host,
ServerAddresses: cloneBootstrap(), </s> remove copyInstallSettings(&config, &curConfig)
</s> add copyInstallSettings(config, curConfig) </s> remove copyInstallSettings(&config, &curConfig)
</s> add copyInstallSettings(config, curConfig) </s> remove restartHTTP := true
if config.BindHost.Equal(req.Web.IP) && config.BindPort == req.Web.Port {
// no need to rebind
restartHTTP = false
}
// validate that hosts and ports are bindable
if restartHTTP {
err = aghnet.CheckPortAvailable(req.Web.IP, req.Web.Port)
if err != nil {
httpError(
w,
http.StatusBadRequest,
"can not listen on IP:port %s: %s",
netutil.JoinHostPort(req.Web.IP.String(), req.Web.Port),
err,
)
return
}
}
</s> add </s> remove req := applyConfigReq{}
err := json.NewDecoder(r.Body).Decode(&req)
</s> add req, restartHTTP, err := decodeApplyConfigReq(r.Body) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
// cloneBootstrap returns a clone of the current bootstrap DNS servers.
func cloneBootstrap() (bootstrap []string) {
config.RLock()
defer config.RUnlock()
return stringutil.CloneSlice(config.DNS.BootstrapDNS)
}
| <mask>
<mask> _, _ = w.Write(mobileconfig)
<mask> }
<mask>
<mask> func handleMobileConfigDoH(w http.ResponseWriter, r *http.Request) {
<mask> handleMobileConfig(w, r, dnsProtoHTTPS)
<mask> }
<mask>
<mask> func handleMobileConfigDoT(w http.ResponseWriter, r *http.Request) {
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove req := applyConfigReq{}
err := json.NewDecoder(r.Body).Decode(&req)
</s> add req, restartHTTP, err := decodeApplyConfigReq(r.Body) </s> remove httpError(w, http.StatusBadRequest, "Failed to parse 'configure' JSON: %s", err)
return
}
</s> add httpError(w, http.StatusBadRequest, "%s", err) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig.go |
"github.com/AdguardTeam/AdGuardHome/internal/dnsforward" | <mask> "net/http/httptest"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> "howett.net/plist"
<mask> )
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add </s> remove func getMobileConfig(d dnsSettings) ([]byte, error) {
</s> add func encodeMobileConfig(d *dnsSettings, clientID string) ([]byte, error) { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
setupBootstraps(t)
| <mask> }
<mask> }
<mask>
<mask> func TestHandleMobileConfigDoH(t *testing.T) {
<mask> t.Run("success", func(t *testing.T) {
<mask> r, err := http.NewRequest(http.MethodGet, "https://example.com:12345/apple/doh.mobileconfig?host=example.org", nil)
<mask> require.NoError(t, err)
<mask>
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
<mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
<mask> })
<mask>
<mask> t.Run("error_no_host", func(t *testing.T) {
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query", s.ServerURL) </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
|
s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query", s.ServerURL) | <mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
<mask> })
<mask>
<mask> t.Run("error_no_host", func(t *testing.T) {
<mask> oldTLSConf := Context.tls
<mask> t.Cleanup(func() { Context.tls = oldTLSConf })
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
<mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
<mask> })
<mask> }
<mask>
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) </s> remove assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query", s.ServerURL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
|
s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) | <mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoH", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
<mask> })
<mask> }
<mask>
<mask> func TestHandleMobileConfigDoT(t *testing.T) {
<mask> t.Run("success", func(t *testing.T) {
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query", s.ServerURL) </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
setupBootstraps(t)
| <mask> }
<mask>
<mask> func TestHandleMobileConfigDoT(t *testing.T) {
<mask> t.Run("success", func(t *testing.T) {
<mask> r, err := http.NewRequest(http.MethodGet, "https://example.com:12345/apple/dot.mobileconfig?host=example.org", nil)
<mask> require.NoError(t, err)
<mask>
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "https://example.org/dns-query/cli42", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query/cli42", s.ServerURL) </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
<mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
<mask> })
<mask>
<mask> t.Run("error_no_host", func(t *testing.T) {
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "cli42.example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
|
s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | <mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
<mask> })
<mask>
<mask> t.Run("error_no_host", func(t *testing.T) {
<mask> oldTLSConf := Context.tls
<mask> t.Cleanup(func() { Context.tls = oldTLSConf })
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "https://example.org/dns-query", mc.PayloadContent[0].DNSSettings.ServerURL)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Empty(t, s.ServerName)
assert.Equal(t, "https://example.org/dns-query", s.ServerURL) </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "cli42.example.org", s.ServerName)
assert.Empty(t, s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
<mask> _, err = plist.Unmarshal(w.Body.Bytes(), &mc)
<mask> require.NoError(t, err)
<mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
<mask> })
<mask> }
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "cli42.example.org", s.ServerName)
assert.Empty(t, s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
|
s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "cli42.example.org", s.ServerName)
assert.Empty(t, s.ServerURL) | <mask>
<mask> require.Len(t, mc.PayloadContent, 1)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
<mask> assert.Equal(t, "example.org DoT", mc.PayloadContent[0].PayloadDisplayName)
<mask> assert.Equal(t, "cli42.example.org", mc.PayloadContent[0].DNSSettings.ServerName)
<mask> })
<mask> }
</s> Pull request: home: add bootstrap to mobileconfig, imp code
Updates #3568.
Squashed commit of the following:
commit ec342e6223e2b2efe9a8bf833d5406a44c6417e4
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 15:16:07 2021 +0300
home: imp tests
commit 67cd771e631938d3e8a5340315314210de796174
Author: Ainar Garipov <[email protected]>
Date: Mon Sep 13 14:34:03 2021 +0300
home: add bootstrap to mobileconfig, imp code </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoT", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org", mc.PayloadContent[0].DNSSettings.ServerName)
</s> add s := mc.PayloadContent[0].DNSSettings
require.NotNil(t, s)
assert.Equal(t, testBootstrapDNS, s.ServerAddresses)
assert.Equal(t, "example.org", s.ServerName)
assert.Empty(t, s.ServerURL) </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add </s> remove assert.Equal(t, "example.org DoH", mc.PayloadContent[0].Name)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/424f20da985b043ce4a6c5b5830d3e414e832196 | internal/home/mobileconfig_test.go |
// RegisterFunc is the function that sets the handler to handle the URL for the
// method.
//
// TODO(e.burkov, a.garipov): Get rid of it.
type RegisterFunc func(method, url string, handler http.HandlerFunc)
| <mask> )
<mask>
<mask> // OK responds with word OK.
<mask> func OK(w http.ResponseWriter) {
<mask> if _, err := io.WriteString(w, "OK\n"); err != nil {
<mask> log.Error("couldn't write body: %s", err)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove log.Debug("tx.Commit: %s", err)
</s> add log.Error("stats: committing a transaction: %s", err)
</s> remove log.Error("db.Begin: %s", err)
</s> add log.Error("stats: opening a transaction: %s", err)
</s> remove log.Tracef("db.Begin...")
tx, err := db.Begin(wr)
</s> add log.Tracef("opening a database transaction")
tx, err := db.Begin(writable) </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove log.Tracef("db.Begin")
</s> add log.Tracef("transaction has been opened")
| [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/aghhttp/aghhttp.go |
<mask> import (
<mask> "encoding/json"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "path/filepath"
<mask> "runtime"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dhcpd/dhcpd.go |
|
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> "runtime"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> )
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove bolt "go.etcd.io/bbolt"
</s> add "go.etcd.io/bbolt" | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dhcpd/dhcpd.go |
HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | <mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func() `yaml:"-"`
<mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
<mask>
<mask> Enabled bool `yaml:"enabled"`
<mask> InterfaceName string `yaml:"interface_name"`
<mask>
<mask> // LocalDomainName is the domain name used for DHCP hosts. For example,
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dhcpd/dhcpd.go |
<mask> "crypto/tls"
<mask> "crypto/x509"
<mask> "fmt"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "sort"
<mask> "strings"
<mask> "time"
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/config.go |
|
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtls"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/config.go |
HTTPRegister aghhttp.RegisterFunc | <mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func()
<mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask>
<mask> // ResolveClients signals if the RDNS should resolve clients' addresses.
<mask> ResolveClients bool
<mask>
<mask> // UsePrivateRDNS defines if the PTR requests for unknown addresses from
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/config.go |
stats stats.Interface | <mask> dnsProxy *proxy.Proxy // DNS proxy instance
<mask> dnsFilter *filtering.DNSFilter // DNS filter instance
<mask> dhcpServer dhcpd.ServerInterface // DHCP server instance (optional)
<mask> queryLog querylog.QueryLog // Query log instance
<mask> stats stats.Stats
<mask> access *accessCtx
<mask>
<mask> // localDomainSuffix is the suffix used to detect internal hosts. It
<mask> // must be a valid domain name plus dots on each side.
<mask> localDomainSuffix string
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove stats stats.Stats // statistics module
</s> add stats stats.Interface // statistics module </s> remove // It is still possible that the IP used to be in the runtime
// clients list, but then the server was reloaded. So, check
// the DNS server's blocked IP list.
</s> add // It is still possible that the IP used to be in the runtime clients
// list, but then the server was reloaded. So, check the DNS server's
// blocked IP list. </s> remove Stats stats.Stats
</s> add Stats stats.Interface </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/dnsforward.go |
Stats stats.Interface | <mask>
<mask> // DNSCreateParams are parameters to create a new server.
<mask> type DNSCreateParams struct {
<mask> DNSFilter *filtering.DNSFilter
<mask> Stats stats.Stats
<mask> QueryLog querylog.QueryLog
<mask> DHCPServer dhcpd.ServerInterface
<mask> PrivateNets netutil.SubnetSet
<mask> Anonymizer *aghnet.IPMut
<mask> LocalDomain string
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove stats stats.Stats
</s> add stats stats.Interface </s> remove stats.Stats
</s> add stats.Interface </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove stats stats.Stats // statistics module
</s> add stats stats.Interface // statistics module | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/dnsforward.go |
stats.Interface | <mask> // testStats is a simple stats.Stats implementation for tests.
<mask> type testStats struct {
<mask> // Stats is embedded here simply to make testStats a stats.Stats without
<mask> // actually implementing all methods.
<mask> stats.Stats
<mask>
<mask> lastEntry stats.Entry
<mask> }
<mask>
<mask> // Update implements the stats.Stats interface for *testStats.
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Stats stats.Stats
</s> add Stats stats.Interface </s> remove stats stats.Stats
</s> add stats stats.Interface </s> remove // Close object.
// This function is not thread safe
// (can't be called in parallel with any other function of this interface).
</s> add // Close stops the statistics collecting. </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove // Stats - main interface
type Stats interface {
</s> add // Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/dnsforward/stats_test.go |
<mask> "context"
<mask> "fmt"
<mask> "io/fs"
<mask> "net"
<mask> "net/http"
<mask> "os"
<mask> "runtime"
<mask> "runtime/debug"
<mask> "strings"
<mask> "sync"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/filtering/filtering.go |
|
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> "strings"
<mask> "sync"
<mask> "sync/atomic"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/cache"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/filtering/filtering.go |
HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | <mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func() `yaml:"-"`
<mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
<mask>
<mask> // CustomResolver is the resolver used by DNSFilter.
<mask> CustomResolver Resolver `yaml:"-"`
<mask> }
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/filtering/filtering.go |
"encoding" | <mask> package home
<mask>
<mask> import (
<mask> "bytes"
<mask> "fmt"
<mask> "net"
<mask> "sort"
<mask> "strings"
<mask> "sync"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/clients.go |
Name string `json:"name"`
Source clientSource `json:"source"`
IP net.IP `json:"ip"` | <mask>
<mask> type runtimeClientJSON struct {
<mask> WHOISInfo *RuntimeClientWHOISInfo `json:"whois_info"`
<mask>
<mask> Name string `json:"name"`
<mask> Source string `json:"source"`
<mask> IP net.IP `json:"ip"`
<mask> }
<mask>
<mask> type clientListJSON struct {
<mask> Clients []*clientJSON `json:"clients"`
<mask> RuntimeClients []runtimeClientJSON `json:"auto_clients"`
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // structure for storing data in file
</s> add // unitDB is the structure for deserializing statistics data into the database. </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove Stats stats.Stats
</s> add Stats stats.Interface </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/clientshttp.go |
Name: rc.Host,
Source: rc.Source,
IP: ip, | <mask>
<mask> cj := runtimeClientJSON{
<mask> WHOISInfo: rc.WHOISInfo,
<mask>
<mask> Name: rc.Host,
<mask> IP: ip,
<mask> }
<mask>
<mask> cj.Source = "etc/hosts"
<mask> switch rc.Source {
<mask> case ClientSourceDHCP:
<mask> cj.Source = "DHCP"
<mask> case ClientSourceRDNS:
<mask> cj.Source = "rDNS"
<mask> case ClientSourceARP:
<mask> cj.Source = "ARP"
<mask> case ClientSourceWHOIS:
<mask> cj.Source = "WHOIS"
<mask> }
<mask>
<mask> data.RuntimeClients = append(data.RuntimeClients, cj)
<mask>
<mask> return true
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove if s.conf.limit == 0 {
resp = statsResponse{
TimeUnits: "days",
TopBlocked: []topAddrs{},
TopClients: []topAddrs{},
TopQueried: []topAddrs{},
BlockedFiltering: []uint64{},
DNSQueries: []uint64{},
ReplacedParental: []uint64{},
ReplacedSafebrowsing: []uint64{},
}
} else {
var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return
}
</s> add var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
// Don't bring the message to the lower case since it's a part of UI
// text for the moment.
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return </s> remove // Atomically swap the currently active unit with a new value
// Return old value
func (s *statsCtx) swapUnit(new *unit) (u *unit) {
s.mu.Lock()
defer s.mu.Unlock()
</s> add return err
} </s> remove
s.conf = &Config{}
*s.conf = conf
s.conf.limit = conf.LimitDays * 24
if conf.UnitID == nil {
s.conf.UnitID = newUnitID
</s> add if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID </s> remove func (s *statsCtx) loadUnitFromDB(tx *bolt.Tx, id uint32) *unitDB {
</s> add func (s *StatsCtx) loadUnitFromDB(tx *bbolt.Tx, id uint32) *unitDB { </s> remove func convertTopSlice(a []countPair) []map[string]uint64 {
m := []map[string]uint64{}
</s> add func convertTopSlice(a []countPair) (m []map[string]uint64) {
m = make([]map[string]uint64, 0, len(a)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/clientshttp.go |
aghhttp.Error(r, w, http.StatusInternalServerError, "failed to encode to json: %v", e) | <mask>
<mask> w.Header().Set("Content-Type", "application/json")
<mask> e := json.NewEncoder(w).Encode(data)
<mask> if e != nil {
<mask> aghhttp.Error(
<mask> r,
<mask> w,
<mask> http.StatusInternalServerError,
<mask> "Failed to encode to json: %v",
<mask> e,
<mask> )
<mask>
<mask> return
<mask> }
<mask> }
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove if s.conf.limit == 0 {
resp = statsResponse{
TimeUnits: "days",
TopBlocked: []topAddrs{},
TopClients: []topAddrs{},
TopQueried: []topAddrs{},
BlockedFiltering: []uint64{},
DNSQueries: []uint64{},
ReplacedParental: []uint64{},
ReplacedSafebrowsing: []uint64{},
}
} else {
var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return
}
</s> add var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
// Don't bring the message to the lower case since it's a part of UI
// text for the moment.
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) commitTxn(tx *bolt.Tx) {
</s> add // commitTxn applies the changes made in tx to the database.
func (s *StatsCtx) commitTxn(tx *bbolt.Tx) { </s> remove func serialize(u *unit) *unitDB {
udb := unitDB{}
udb.NTotal = u.nTotal
udb.NResult = append(udb.NResult, u.nResult...)
</s> add // serialize converts u to the *unitDB. It's safe for concurrent use.
func (u *unit) serialize() (udb *unitDB) {
u.mu.RLock()
defer u.mu.RUnlock() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/clientshttp.go |
// It is still possible that the IP used to be in the runtime clients
// list, but then the server was reloaded. So, check the DNS server's
// blocked IP list. | <mask> // non-nil.
<mask> func (clients *clientsContainer) findRuntime(ip net.IP, idStr string) (cj *clientJSON) {
<mask> rc, ok := clients.FindRuntimeClient(ip)
<mask> if !ok {
<mask> // It is still possible that the IP used to be in the runtime
<mask> // clients list, but then the server was reloaded. So, check
<mask> // the DNS server's blocked IP list.
<mask> //
<mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/2428.
<mask> disallowed, rule := clients.dnsServer.IsBlockedClient(ip, idStr)
<mask> cj = &clientJSON{
<mask> IDs: []string{idStr},
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove stats stats.Stats
</s> add stats stats.Interface </s> remove // Get IP addresses of the clients with the most number of requests
</s> add // GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. </s> remove // Update counters
</s> add // Update collects the incoming statistics data. </s> remove // Stats - main interface
type Stats interface {
</s> add // Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. </s> remove // WriteDiskConfig - write configuration
</s> add // WriteDiskConfig puts the Interface's configuration to the dc. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/clientshttp.go |
func httpRegister(method, url string, handler http.HandlerFunc) { | <mask> Context.mux.HandleFunc("/apple/dot.mobileconfig", postInstall(handleMobileConfigDoT))
<mask> RegisterAuthHandlers()
<mask> }
<mask>
<mask> func httpRegister(method, url string, handler func(http.ResponseWriter, *http.Request)) {
<mask> if method == "" {
<mask> // "/dns-query" handler doesn't need auth, gzip and isn't restricted by 1 HTTP method
<mask> Context.mux.HandleFunc(url, postInstall(handler))
<mask> return
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove limit uint32 // maximum time we need to keep data for (in hours)
}
</s> add // Filename is the name of the database file.
Filename string </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/control.go |
stats stats.Interface // statistics module | <mask> // Modules
<mask> // --
<mask>
<mask> clients clientsContainer // per-client-settings module
<mask> stats stats.Stats // statistics module
<mask> queryLog querylog.QueryLog // query log module
<mask> dnsServer *dnsforward.Server // DNS module
<mask> rdns *RDNS // rDNS module
<mask> whois *WHOIS // WHOIS module
<mask> dnsFilter *filtering.DNSFilter // DNS filtering module
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove stats stats.Stats
</s> add stats stats.Interface </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/home/home.go |
<mask> package querylog
<mask>
<mask> import (
<mask> "net"
<mask> "net/http"
<mask> "path/filepath"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/querylog/querylog.go |
|
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/timeutil"
<mask> "github.com/miekg/dns"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/querylog/querylog.go |
HTTPRegister aghhttp.RegisterFunc | <mask> // example by HTTP requests.
<mask> ConfigModified func()
<mask>
<mask> // HTTPRegister registers an HTTP handler.
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask>
<mask> // FindClient returns client information by their IDs.
<mask> FindClient func(ids []string) (c *Client, err error)
<mask>
<mask> // BaseDir is the base directory for log files.
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/querylog/querylog.go |
func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { | <mask> ReplacedParental []uint64 `json:"replaced_parental"`
<mask> }
<mask>
<mask> // handleStats is a handler for getting statistics.
<mask> func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
<mask> start := time.Now()
<mask>
<mask> var resp statsResponse
<mask> if s.conf.limit == 0 {
<mask> resp = statsResponse{
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove if s.conf.limit == 0 {
resp = statsResponse{
TimeUnits: "days",
TopBlocked: []topAddrs{},
TopClients: []topAddrs{},
TopQueried: []topAddrs{},
BlockedFiltering: []uint64{},
DNSQueries: []uint64{},
ReplacedParental: []uint64{},
ReplacedSafebrowsing: []uint64{},
}
} else {
var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return
}
</s> add var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
// Don't bring the message to the lower case since it's a part of UI
// text for the moment.
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
// Don't bring the message to the lower case since it's a part of UI
// text for the moment.
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return | <mask> func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
<mask> start := time.Now()
<mask>
<mask> var resp statsResponse
<mask> if s.conf.limit == 0 {
<mask> resp = statsResponse{
<mask> TimeUnits: "days",
<mask>
<mask> TopBlocked: []topAddrs{},
<mask> TopClients: []topAddrs{},
<mask> TopQueried: []topAddrs{},
<mask>
<mask> BlockedFiltering: []uint64{},
<mask> DNSQueries: []uint64{},
<mask> ReplacedParental: []uint64{},
<mask> ReplacedSafebrowsing: []uint64{},
<mask> }
<mask> } else {
<mask> var ok bool
<mask> resp, ok = s.getData()
<mask>
<mask> log.Debug("stats: prepared data in %v", time.Since(start))
<mask>
<mask> if !ok {
<mask> aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
<mask>
<mask> return
<mask> }
<mask> }
<mask>
<mask> w.Header().Set("Content-Type", "application/json")
<mask>
<mask> err := json.NewEncoder(w).Encode(resp)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove func (s *statsCtx) getData() (statsResponse, bool) {
limit := s.conf.limit
</s> add func (s *StatsCtx) getData() (statsResponse, bool) {
limit := atomic.LoadUint32(&s.limitHours)
if limit == 0 {
return statsResponse{
TimeUnits: "days",
TopBlocked: []topAddrs{},
TopClients: []topAddrs{},
TopQueried: []topAddrs{},
BlockedFiltering: []uint64{},
DNSQueries: []uint64{},
ReplacedParental: []uint64{},
ReplacedSafebrowsing: []uint64{},
}, true
} </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 </s> remove aghhttp.Error(
r,
w,
http.StatusInternalServerError,
"Failed to encode to json: %v",
e,
)
</s> add aghhttp.Error(r, w, http.StatusInternalServerError, "failed to encode to json: %v", e) </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { | <mask> IntervalDays uint32 `json:"interval"`
<mask> }
<mask>
<mask> // Get configuration
<mask> func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
<mask> resp := config{}
<mask> resp.IntervalDays = s.conf.limit / 24
<mask>
<mask> data, err := json.Marshal(resp)
<mask> if err != nil {
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { </s> remove s.conf.ConfigModified()
</s> add s.configModified() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
resp.IntervalDays = s.limitHours / 24 | <mask>
<mask> // Get configuration
<mask> func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
<mask> resp := config{}
<mask> resp.IntervalDays = s.conf.limit / 24
<mask>
<mask> data, err := json.Marshal(resp)
<mask> if err != nil {
<mask> aghhttp.Error(r, w, http.StatusInternalServerError, "json encode: %s", err)
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { </s> remove if s.conf.limit == 0 {
resp = statsResponse{
TimeUnits: "days",
TopBlocked: []topAddrs{},
TopClients: []topAddrs{},
TopQueried: []topAddrs{},
BlockedFiltering: []uint64{},
DNSQueries: []uint64{},
ReplacedParental: []uint64{},
ReplacedSafebrowsing: []uint64{},
}
} else {
var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return
}
</s> add var ok bool
resp, ok = s.getData()
log.Debug("stats: prepared data in %v", time.Since(start))
if !ok {
// Don't bring the message to the lower case since it's a part of UI
// text for the moment.
aghhttp.Error(r, w, http.StatusInternalServerError, "Couldn't get statistics data")
return </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { | <mask> }
<mask> }
<mask>
<mask> // Set configuration
<mask> func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
<mask> reqData := config{}
<mask> err := json.NewDecoder(r.Body).Decode(&reqData)
<mask> if err != nil {
<mask> aghhttp.Error(r, w, http.StatusBadRequest, "json decode: %s", err)
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { </s> remove log.Debug("tx.Commit: %s", err)
</s> add log.Error("stats: committing a transaction: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
s.configModified() | <mask> return
<mask> }
<mask>
<mask> s.setLimit(int(reqData.IntervalDays))
<mask> s.conf.ConfigModified()
<mask> }
<mask>
<mask> // Reset data
<mask> func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
<mask> s.clear()
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { </s> remove resp.IntervalDays = s.conf.limit / 24
</s> add resp.IntervalDays = s.limitHours / 24 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { | <mask> s.conf.ConfigModified()
<mask> }
<mask>
<mask> // Reset data
<mask> func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
<mask> s.clear()
<mask> }
<mask>
<mask> // Register web handlers
<mask> func (s *statsCtx) initWeb() {
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove s.conf.ConfigModified()
</s> add s.configModified() </s> remove func (s *statsCtx) initWeb() {
if s.conf.HTTPRegister == nil {
</s> add func (s *StatsCtx) initWeb() {
if s.httpRegister == nil { </s> remove func (s *statsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsConfig(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsInfo(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStats(w http.ResponseWriter, r *http.Request) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
func (s *StatsCtx) initWeb() {
if s.httpRegister == nil { | <mask> s.clear()
<mask> }
<mask>
<mask> // Register web handlers
<mask> func (s *statsCtx) initWeb() {
<mask> if s.conf.HTTPRegister == nil {
<mask> return
<mask> }
<mask>
<mask> s.conf.HTTPRegister(http.MethodGet, "/control/stats", s.handleStats)
<mask> s.conf.HTTPRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove s.conf.HTTPRegister(http.MethodGet, "/control/stats", s.handleStats)
s.conf.HTTPRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
s.conf.HTTPRegister(http.MethodPost, "/control/stats_config", s.handleStatsConfig)
s.conf.HTTPRegister(http.MethodGet, "/control/stats_info", s.handleStatsInfo)
</s> add s.httpRegister(http.MethodGet, "/control/stats", s.handleStats)
s.httpRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
s.httpRegister(http.MethodPost, "/control/stats_config", s.handleStatsConfig)
s.httpRegister(http.MethodGet, "/control/stats_info", s.handleStatsInfo) </s> remove func (s *statsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) {
</s> add func (s *StatsCtx) handleStatsReset(w http.ResponseWriter, r *http.Request) { </s> remove func (s *statsCtx) setLimit(limitDays int) {
s.conf.limit = uint32(limitDays) * 24
</s> add func (s *StatsCtx) setLimit(limitDays int) {
atomic.StoreUint32(&s.limitHours, uint32(24*limitDays)) </s> remove s.conf.ConfigModified()
</s> add s.configModified() </s> remove log.Debug("stats: set limit: %d", limitDays)
</s> add log.Debug("stats: set limit: %d days", limitDays) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
s.httpRegister(http.MethodGet, "/control/stats", s.handleStats)
s.httpRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
s.httpRegister(http.MethodPost, "/control/stats_config", s.handleStatsConfig)
s.httpRegister(http.MethodGet, "/control/stats_info", s.handleStatsInfo) | <mask> if s.conf.HTTPRegister == nil {
<mask> return
<mask> }
<mask>
<mask> s.conf.HTTPRegister(http.MethodGet, "/control/stats", s.handleStats)
<mask> s.conf.HTTPRegister(http.MethodPost, "/control/stats_reset", s.handleStatsReset)
<mask> s.conf.HTTPRegister(http.MethodPost, "/control/stats_config", s.handleStatsConfig)
<mask> s.conf.HTTPRegister(http.MethodGet, "/control/stats_info", s.handleStatsInfo)
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove func (s *statsCtx) initWeb() {
if s.conf.HTTPRegister == nil {
</s> add func (s *StatsCtx) initWeb() {
if s.httpRegister == nil { </s> remove units, _ := s.loadUnits(s.conf.limit)
</s> add units, _ := s.loadUnits(atomic.LoadUint32(&s.limitHours)) </s> remove func (s *statsCtx) GetTopClientsIP(maxCount uint) []net.IP {
if s.conf.limit == 0 {
</s> add func (s *StatsCtx) GetTopClientsIP(maxCount uint) []net.IP {
if !s.isEnabled() { </s> remove log.Tracef("db.Begin...")
tx, err := db.Begin(wr)
</s> add log.Tracef("opening a database transaction")
tx, err := db.Begin(writable) </s> remove func (s *statsCtx) loadUnitFromDB(tx *bolt.Tx, id uint32) *unitDB {
</s> add func (s *StatsCtx) loadUnitFromDB(tx *bbolt.Tx, id uint32) *unitDB { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/http.go |
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> package stats
<mask>
<mask> import (
<mask> "net"
<mask> "net/http"
<mask> )
<mask>
<mask> type unitIDCallback func() uint32
<mask>
<mask> // DiskConfig - configuration settings that are stored on disk
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) | <mask> "net"
<mask> "net/http"
<mask> )
<mask>
<mask> type unitIDCallback func() uint32
<mask>
<mask> // DiskConfig - configuration settings that are stored on disk
<mask> type DiskConfig struct {
<mask> Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// DiskConfig is the configuration structure that is stored in file. | <mask> )
<mask>
<mask> type unitIDCallback func() uint32
<mask>
<mask> // DiskConfig - configuration settings that are stored on disk
<mask> type DiskConfig struct {
<mask> Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
<mask> }
<mask>
<mask> // Config - module configuration
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` | <mask> type unitIDCallback func() uint32
<mask>
<mask> // DiskConfig - configuration settings that are stored on disk
<mask> type DiskConfig struct {
<mask> Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
<mask> }
<mask>
<mask> // Config - module configuration
<mask> type Config struct {
<mask> Filename string // database file name
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) </s> remove "net/http"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Config is the configuration structure for the statistics collecting. | <mask> type DiskConfig struct {
<mask> Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
<mask> }
<mask>
<mask> // Config - module configuration
<mask> type Config struct {
<mask> Filename string // database file name
<mask> LimitDays uint32 // time limit (in days)
<mask> UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc | <mask> }
<mask>
<mask> // Config - module configuration
<mask> type Config struct {
<mask> Filename string // database file name
<mask> LimitDays uint32 // time limit (in days)
<mask> UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
<mask>
<mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func()
<mask>
<mask> // Register an HTTP handler
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
</s> add // Interval is the number of days for which the statistics are collected
// before flushing to the database.
Interval uint32 `yaml:"statistics_interval"` </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// ConfigModified will be called each time the configuration changed via web
// interface. | <mask> Filename string // database file name
<mask> LimitDays uint32 // time limit (in days)
<mask> UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
<mask>
<mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func()
<mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Filename string // database file name
LimitDays uint32 // time limit (in days)
UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used.
</s> add // UnitID is the function to generate the identifier for current unit. If
// nil, the default function is used, see newUnitID.
UnitID UnitIDGenFunc </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc | <mask>
<mask> // Called when the configuration is changed by HTTP request
<mask> ConfigModified func()
<mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask>
<mask> limit uint32 // maximum time we need to keep data for (in hours)
<mask> }
<mask>
<mask> // New - create object
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove limit uint32 // maximum time we need to keep data for (in hours)
}
</s> add // Filename is the name of the database file.
Filename string </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add HTTPRegister aghhttp.RegisterFunc | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Filename is the name of the database file.
Filename string | <mask>
<mask> // Register an HTTP handler
<mask> HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
<mask>
<mask> limit uint32 // maximum time we need to keep data for (in hours)
<mask> }
<mask>
<mask> // New - create object
<mask> func New(conf Config) (Stats, error) {
<mask> return createObject(conf)
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove // Called when the configuration is changed by HTTP request
</s> add // ConfigModified will be called each time the configuration changed via web
// interface. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 | <mask>
<mask> limit uint32 // maximum time we need to keep data for (in hours)
<mask> }
<mask>
<mask> // New - create object
<mask> func New(conf Config) (Stats, error) {
<mask> return createObject(conf)
<mask> }
<mask>
<mask> // Stats - main interface
<mask> type Stats interface {
<mask> Start()
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove limit uint32 // maximum time we need to keep data for (in hours)
}
</s> add // Filename is the name of the database file.
Filename string </s> remove // Stats - main interface
type Stats interface {
</s> add // Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. </s> remove // Register an HTTP handler
HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request))
</s> add // HTTPRegister is the function that registers handlers for the stats
// endpoints.
HTTPRegister aghhttp.RegisterFunc </s> remove // Close object.
// This function is not thread safe
// (can't be called in parallel with any other function of this interface).
</s> add // Close stops the statistics collecting. </s> remove stats.Stats
</s> add stats.Interface | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. | <mask> func New(conf Config) (Stats, error) {
<mask> return createObject(conf)
<mask> }
<mask>
<mask> // Stats - main interface
<mask> type Stats interface {
<mask> Start()
<mask>
<mask> // Close object.
<mask> // This function is not thread safe
<mask> // (can't be called in parallel with any other function of this interface).
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Close object.
// This function is not thread safe
// (can't be called in parallel with any other function of this interface).
</s> add // Close stops the statistics collecting. </s> remove // Update counters
</s> add // Update collects the incoming statistics data. </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove limit uint32 // maximum time we need to keep data for (in hours)
}
</s> add // Filename is the name of the database file.
Filename string </s> remove stats.Stats
</s> add stats.Interface | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Close stops the statistics collecting. | <mask> // Stats - main interface
<mask> type Stats interface {
<mask> Start()
<mask>
<mask> // Close object.
<mask> // This function is not thread safe
<mask> // (can't be called in parallel with any other function of this interface).
<mask> Close()
<mask>
<mask> // Update counters
<mask> Update(e Entry)
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Stats - main interface
type Stats interface {
</s> add // Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. </s> remove // Update counters
</s> add // Update collects the incoming statistics data. </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove stats.Stats
</s> add stats.Interface </s> remove // Get IP addresses of the clients with the most number of requests
</s> add // GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Update collects the incoming statistics data. | <mask> // This function is not thread safe
<mask> // (can't be called in parallel with any other function of this interface).
<mask> Close()
<mask>
<mask> // Update counters
<mask> Update(e Entry)
<mask>
<mask> // Get IP addresses of the clients with the most number of requests
<mask> GetTopClientsIP(limit uint) []net.IP
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Close object.
// This function is not thread safe
// (can't be called in parallel with any other function of this interface).
</s> add // Close stops the statistics collecting. </s> remove // Get IP addresses of the clients with the most number of requests
</s> add // GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. </s> remove // Stats - main interface
type Stats interface {
</s> add // Interface is the statistics interface to be used by other packages.
type Interface interface {
// Start begins the statistics collecting. </s> remove // WriteDiskConfig - write configuration
</s> add // WriteDiskConfig puts the Interface's configuration to the dc. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. | <mask>
<mask> // Update counters
<mask> Update(e Entry)
<mask>
<mask> // Get IP addresses of the clients with the most number of requests
<mask> GetTopClientsIP(limit uint) []net.IP
<mask>
<mask> // WriteDiskConfig - write configuration
<mask> WriteDiskConfig(dc *DiskConfig)
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // WriteDiskConfig - write configuration
</s> add // WriteDiskConfig puts the Interface's configuration to the dc. </s> remove // Update counters
</s> add // Update collects the incoming statistics data. </s> remove // TimeUnit - time unit
</s> add // TimeUnit is the unit of measuring time while aggregating the statistics. </s> remove // Close object.
// This function is not thread safe
// (can't be called in parallel with any other function of this interface).
</s> add // Close stops the statistics collecting. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// WriteDiskConfig puts the Interface's configuration to the dc. | <mask>
<mask> // Get IP addresses of the clients with the most number of requests
<mask> GetTopClientsIP(limit uint) []net.IP
<mask>
<mask> // WriteDiskConfig - write configuration
<mask> WriteDiskConfig(dc *DiskConfig)
<mask> }
<mask>
<mask> // TimeUnit - time unit
<mask> type TimeUnit int
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Get IP addresses of the clients with the most number of requests
</s> add // GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. </s> remove // TimeUnit - time unit
</s> add // TimeUnit is the unit of measuring time while aggregating the statistics. </s> remove // Update counters
</s> add // Update collects the incoming statistics data. </s> remove // Supported time units
</s> add // Supported TimeUnit values. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// TimeUnit is the unit of measuring time while aggregating the statistics. | <mask> // WriteDiskConfig - write configuration
<mask> WriteDiskConfig(dc *DiskConfig)
<mask> }
<mask>
<mask> // TimeUnit - time unit
<mask> type TimeUnit int
<mask>
<mask> // Supported time units
<mask> const (
<mask> Hours TimeUnit = iota
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Supported time units
</s> add // Supported TimeUnit values. </s> remove // WriteDiskConfig - write configuration
</s> add // WriteDiskConfig puts the Interface's configuration to the dc. </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove // Get IP addresses of the clients with the most number of requests
</s> add // GetTopClientIP returns at most limit IP addresses corresponding to the
// clients with the most number of requests. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Supported TimeUnit values. | <mask>
<mask> // TimeUnit - time unit
<mask> type TimeUnit int
<mask>
<mask> // Supported time units
<mask> const (
<mask> Hours TimeUnit = iota
<mask> Days
<mask> )
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // TimeUnit - time unit
</s> add // TimeUnit is the unit of measuring time while aggregating the statistics. </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove // WriteDiskConfig - write configuration
</s> add // WriteDiskConfig puts the Interface's configuration to the dc. </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove // DiskConfig - configuration settings that are stored on disk
</s> add // DiskConfig is the configuration structure that is stored in file. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Result is the resulting code of processing the DNS request. | <mask> Hours TimeUnit = iota
<mask> Days
<mask> )
<mask>
<mask> // Result of DNS request processing
<mask> type Result int
<mask>
<mask> // Supported result values
<mask> const (
<mask> RNotFiltered Result = iota + 1
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove // Supported time units
</s> add // Supported TimeUnit values. </s> remove // TimeUnit - time unit
</s> add // TimeUnit is the unit of measuring time while aggregating the statistics. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Supported Result values.
//
// TODO(e.burkov): Think about better naming. | <mask>
<mask> // Result of DNS request processing
<mask> type Result int
<mask>
<mask> // Supported result values
<mask> const (
<mask> RNotFiltered Result = iota + 1
<mask> RFiltered
<mask> RSafeBrowsing
<mask> RSafeSearch
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove Time uint32 // processing time (msec)
</s> add // Time is the duration of the request processing in milliseconds.
Time uint32 </s> remove // Supported time units
</s> add // Supported TimeUnit values. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
resultLast = RParental + 1 | <mask> RFiltered
<mask> RSafeBrowsing
<mask> RSafeSearch
<mask> RParental
<mask> rLast
<mask> )
<mask>
<mask> // Entry is a statistics data entry.
<mask> type Entry struct {
<mask> // Clients is the client's primary ID.
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove db *bolt.DB
conf *Config
</s> add // filename is the name of database file.
filename string
// limitHours is the maximum number of hours to collect statistics into the
// current unit.
limitHours uint32 </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Domain is the domain name requested. | <mask> Client string
<mask>
<mask> Domain string
<mask>
<mask> // Result is the result of processing the request.
<mask> Result Result
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Time uint32 // processing time (msec)
</s> add // Time is the duration of the request processing in milliseconds.
Time uint32 </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Result is the result of processing the request. | <mask>
<mask> // Domain is the domain name requested.
<mask> Domain string
<mask> Result Result
<mask>
<mask> // Time is the duration of the request processing in milliseconds.
<mask> Time uint32
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Time uint32 // processing time (msec)
</s> add // Time is the duration of the request processing in milliseconds.
Time uint32 </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) `yaml:"-"`
</s> add HTTPRegister aghhttp.RegisterFunc `yaml:"-"` | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
// Time is the duration of the request processing in milliseconds.
Time uint32 | <mask> Client string
<mask>
<mask> Domain string
<mask> Result Result
<mask> Time uint32 // processing time (msec)
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // Result of DNS request processing
</s> add // Result is the resulting code of processing the DNS request. </s> remove // Supported result values
</s> add // Supported Result values.
//
// TODO(e.burkov): Think about better naming. </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats.go |
s, err := New(conf) | <mask> Filename: "./stats.db",
<mask> LimitDays: 1,
<mask> }
<mask>
<mask> s, err := createObject(conf)
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, func() (err error) {
<mask> s.clear()
<mask> s.Close()
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove s, err := createObject(conf)
</s> add s, err := New(conf) </s> remove ) (f func(name []byte, b *bolt.Bucket) (err error)) {
return func(name []byte, _ *bolt.Bucket) (err error) {
</s> add ) (f func(name []byte, b *bbolt.Bucket) (err error)) {
return func(name []byte, _ *bbolt.Bucket) (err error) { </s> remove func (s *statsCtx) dbOpen() bool {
var err error
</s> add // dbOpen returns an error if the database can't be opened from the specified
// file. It's safe for concurrent use.
func (s *StatsCtx) dbOpen() (err error) { </s> remove log.Debug("tx.Commit: %s", err)
</s> add log.Error("stats: committing a transaction: %s", err)
</s> remove log.Error("db.Begin: %s", err)
</s> add log.Error("stats: opening a transaction: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats_test.go |
s, err := New(conf) | <mask> Filename: "./stats.db",
<mask> LimitDays: 1,
<mask> UnitID: newID,
<mask> }
<mask> s, err := createObject(conf)
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, func() (err error) {
<mask> s.Close()
<mask>
<mask> return os.Remove(conf.Filename)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove s, err := createObject(conf)
</s> add s, err := New(conf) </s> remove ) (f func(name []byte, b *bolt.Bucket) (err error)) {
return func(name []byte, _ *bolt.Bucket) (err error) {
</s> add ) (f func(name []byte, b *bbolt.Bucket) (err error)) {
return func(name []byte, _ *bbolt.Bucket) (err error) { </s> remove func (s *statsCtx) dbOpen() bool {
var err error
</s> add // dbOpen returns an error if the database can't be opened from the specified
// file. It's safe for concurrent use.
func (s *StatsCtx) dbOpen() (err error) { </s> remove log.Debug("tx.Commit: %s", err)
</s> add log.Error("stats: committing a transaction: %s", err)
</s> remove log.Error("db.Begin: %s", err)
</s> add log.Error("stats: opening a transaction: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/stats_test.go |
"sync/atomic" | <mask> "net"
<mask> "os"
<mask> "sort"
<mask> "sync"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove "net/http"
</s> add </s> remove "net/http"
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "go.etcd.io/bbolt"
<mask> )
<mask>
<mask> // TODO(a.garipov): Rewrite all of this. Add proper error handling and
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove bolt "go.etcd.io/bbolt"
</s> add "go.etcd.io/bbolt" </s> remove TimeAvg uint32 // usec
</s> add // TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
"go.etcd.io/bbolt" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> bolt "go.etcd.io/bbolt"
<mask> )
<mask>
<mask> // TODO(a.garipov): Rewrite all of this. Add proper error handling and
<mask> // inspection. Improve logging. Decrease complexity.
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove TimeAvg uint32 // usec
</s> add // TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// StatsCtx collects the statistics and flushes it to the database. Its default
// flushing interval is one hour.
//
// TODO(e.burkov): Use atomic.Pointer for accessing curr and db in go1.19.
type StatsCtx struct {
// currMu protects the current unit.
currMu *sync.Mutex
// curr is the actual statistics collection result.
curr *unit
// dbMu protects db.
dbMu *sync.Mutex
// db is the opened statistics database, if any.
db *bbolt.DB
// unitIDGen is the function that generates an identifier for the current
// unit. It's here for only testing purposes.
unitIDGen UnitIDGenFunc
// httpRegister is used to set HTTP handlers.
httpRegister aghhttp.RegisterFunc
// configModified is called whenever the configuration is modified via web
// interface.
configModified func() | <mask> maxDomains = 100 // max number of top domains to store in file or return via Get()
<mask> maxClients = 100 // max number of top clients to store in file or return via Get()
<mask> )
<mask>
<mask> // statsCtx - global context
<mask> type statsCtx struct {
<mask> // mu protects unit.
<mask> mu *sync.Mutex
<mask> // current is the actual statistics collection result.
<mask> current *unit
<mask>
<mask> db *bolt.DB
<mask> conf *Config
<mask> }
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove db *bolt.DB
conf *Config
</s> add // filename is the name of database file.
filename string
// limitHours is the maximum number of hours to collect statistics into the
// current unit.
limitHours uint32 </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove // New - create object
func New(conf Config) (Stats, error) {
return createObject(conf)
</s> add // LimitDays is the maximum number of days to collect statistics into the
// current unit.
LimitDays uint32 </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// filename is the name of database file.
filename string
// limitHours is the maximum number of hours to collect statistics into the
// current unit.
limitHours uint32 | <mask> mu *sync.Mutex
<mask> // current is the actual statistics collection result.
<mask> current *unit
<mask>
<mask> db *bolt.DB
<mask> conf *Config
<mask> }
<mask>
<mask> // data for 1 time unit
<mask> type unit struct {
<mask> id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove // statsCtx - global context
type statsCtx struct {
// mu protects unit.
mu *sync.Mutex
// current is the actual statistics collection result.
current *unit
</s> add // StatsCtx collects the statistics and flushes it to the database. Its default
// flushing interval is one hour.
//
// TODO(e.burkov): Use atomic.Pointer for accessing curr and db in go1.19.
type StatsCtx struct {
// currMu protects the current unit.
currMu *sync.Mutex
// curr is the actual statistics collection result.
curr *unit
// dbMu protects db.
dbMu *sync.Mutex
// db is the opened statistics database, if any.
db *bbolt.DB
// unitIDGen is the function that generates an identifier for the current
// unit. It's here for only testing purposes.
unitIDGen UnitIDGenFunc
// httpRegister is used to set HTTP handlers.
httpRegister aghhttp.RegisterFunc
// configModified is called whenever the configuration is modified via web
// interface.
configModified func() </s> remove nTotal uint64 // total requests
nResult []uint64 // number of requests per one result
timeSum uint64 // sum of processing time of all requests (usec)
</s> add // swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove // Config - module configuration
</s> add // Config is the configuration structure for the statistics collecting. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// unit collects the statistics data for a specific period of time. | <mask> db *bolt.DB
<mask> conf *Config
<mask> }
<mask>
<mask> // data for 1 time unit
<mask> type unit struct {
<mask> id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
<mask>
<mask> nTotal uint64 // total requests
<mask> nResult []uint64 // number of requests per one result
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove nTotal uint64 // total requests
nResult []uint64 // number of requests per one result
timeSum uint64 // sum of processing time of all requests (usec)
</s> add // swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove db *bolt.DB
conf *Config
</s> add // filename is the name of database file.
filename string
// limitHours is the maximum number of hours to collect statistics into the
// current unit.
limitHours uint32 </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} | <mask> }
<mask>
<mask> // data for 1 time unit
<mask> type unit struct {
<mask> id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
<mask>
<mask> nTotal uint64 // total requests
<mask> nResult []uint64 // number of requests per one result
<mask> timeSum uint64 // sum of processing time of all requests (usec)
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove nTotal uint64 // total requests
nResult []uint64 // number of requests per one result
timeSum uint64 // sum of processing time of all requests (usec)
</s> add // swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old </s> remove db *bolt.DB
conf *Config
</s> add // filename is the name of database file.
filename string
// limitHours is the maximum number of hours to collect statistics into the
// current unit.
limitHours uint32 </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() | <mask> // data for 1 time unit
<mask> type unit struct {
<mask> id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
<mask>
<mask> nTotal uint64 // total requests
<mask> nResult []uint64 // number of requests per one result
<mask> timeSum uint64 // sum of processing time of all requests (usec)
<mask>
<mask> // top:
<mask> domains map[string]uint64 // number of requests per domain
<mask> blockedDomains map[string]uint64 // number of blocked requests per domain
<mask> clients map[string]uint64 // number of requests per client
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove // name-count pair
</s> add // database returns the database if it's opened. It's safe for concurrent use.
func (s *StatsCtx) database() (db *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
return s.db
}
// swapDatabase swaps the database with another one and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapDatabase(with *bbolt.DB) (old *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
old, s.db = s.db, with
return old
}
// countPair is a single name-number pair for deserializing statistics data into
// the database. </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
old, s.curr = s.curr, with
return old | <mask> nTotal uint64 // total requests
<mask> nResult []uint64 // number of requests per one result
<mask> timeSum uint64 // sum of processing time of all requests (usec)
<mask>
<mask> // top:
<mask> domains map[string]uint64 // number of requests per domain
<mask> blockedDomains map[string]uint64 // number of blocked requests per domain
<mask> clients map[string]uint64 // number of requests per client
<mask> }
<mask>
<mask> // name-count pair
<mask> type countPair struct {
<mask> Name string
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove nTotal uint64 // total requests
nResult []uint64 // number of requests per one result
timeSum uint64 // sum of processing time of all requests (usec)
</s> add // swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove // name-count pair
</s> add // database returns the database if it's opened. It's safe for concurrent use.
func (s *StatsCtx) database() (db *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
return s.db
}
// swapDatabase swaps the database with another one and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapDatabase(with *bbolt.DB) (old *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
old, s.db = s.db, with
return old
}
// countPair is a single name-number pair for deserializing statistics data into
// the database. </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// database returns the database if it's opened. It's safe for concurrent use.
func (s *StatsCtx) database() (db *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
return s.db
}
// swapDatabase swaps the database with another one and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapDatabase(with *bbolt.DB) (old *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
old, s.db = s.db, with
return old
}
// countPair is a single name-number pair for deserializing statistics data into
// the database. | <mask> blockedDomains map[string]uint64 // number of blocked requests per domain
<mask> clients map[string]uint64 // number of requests per client
<mask> }
<mask>
<mask> // name-count pair
<mask> type countPair struct {
<mask> Name string
<mask> Count uint64
<mask> }
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old </s> remove nTotal uint64 // total requests
nResult []uint64 // number of requests per one result
timeSum uint64 // sum of processing time of all requests (usec)
</s> add // swapCurrent swaps the current unit with another and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapCurrent(with *unit) (old *unit) {
s.currMu.Lock()
defer s.currMu.Unlock() </s> remove id uint32 // unit ID. Default: absolute hour since Jan 1, 1970
</s> add // mu protects all the fields of a unit.
mu *sync.RWMutex
// id is the unique unit's identifier. It's set to an absolute hour number
// since the beginning of UNIX time by the default ID generating function.
id uint32
// nTotal stores the total number of requests.
nTotal uint64
// nResult stores the number of requests grouped by it's result.
nResult []uint64
// timeSum stores the sum of processing time in milliseconds of each request
// written by the unit.
timeSum uint64
// domains stores the number of requests for each domain.
domains map[string]uint64
// blockedDomains stores the number of requests for each domain that has
// been blocked.
blockedDomains map[string]uint64
// clients stores the number of requests from each client.
clients map[string]uint64
}
// ongoing returns the current unit. It's safe for concurrent use.
//
// Note that the unit itself should be locked before accessing.
func (s *StatsCtx) ongoing() (u *unit) {
s.currMu.Lock()
defer s.currMu.Unlock()
return s.curr
} </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// unitDB is the structure for deserializing statistics data into the database. | <mask> Name string
<mask> Count uint64
<mask> }
<mask>
<mask> // structure for storing data in file
<mask> type unitDB struct {
<mask> NTotal uint64
<mask> NResult []uint64
<mask>
<mask> Domains []countPair
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. </s> remove // top:
domains map[string]uint64 // number of requests per domain
blockedDomains map[string]uint64 // number of blocked requests per domain
clients map[string]uint64 // number of requests per client
</s> add old, s.curr = s.curr, with
return old </s> remove Clients []countPair
</s> add // Clients is the number of requests from each client.
Clients []countPair </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. | <mask> }
<mask>
<mask> // structure for storing data in file
<mask> type unitDB struct {
<mask> NTotal uint64
<mask> NResult []uint64
<mask>
<mask> Domains []countPair
<mask> BlockedDomains []countPair
<mask> Clients []countPair
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // structure for storing data in file
</s> add // unitDB is the structure for deserializing statistics data into the database. </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. </s> remove Clients []countPair
</s> add // Clients is the number of requests from each client.
Clients []countPair </s> remove TimeAvg uint32 // usec
</s> add // TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. | <mask> type unitDB struct {
<mask> NTotal uint64
<mask> NResult []uint64
<mask>
<mask> Domains []countPair
<mask> BlockedDomains []countPair
<mask> Clients []countPair
<mask>
<mask> TimeAvg uint32 // usec
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. </s> remove Clients []countPair
</s> add // Clients is the number of requests from each client.
Clients []countPair </s> remove // structure for storing data in file
</s> add // unitDB is the structure for deserializing statistics data into the database. </s> remove TimeAvg uint32 // usec
</s> add // TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 </s> remove // data for 1 time unit
</s> add // unit collects the statistics data for a specific period of time. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// Clients is the number of requests from each client.
Clients []countPair | <mask> NResult []uint64
<mask>
<mask> Domains []countPair
<mask> BlockedDomains []countPair
<mask> Clients []countPair
<mask>
<mask> TimeAvg uint32 // usec
<mask> }
<mask>
<mask> // withRecovered turns the value recovered from panic if any into an error and
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove TimeAvg uint32 // usec
</s> add // TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. </s> remove // structure for storing data in file
</s> add // unitDB is the structure for deserializing statistics data into the database. </s> remove return false
}
log.Tracef("db.Open")
return true
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// TimeAvg is the average of processing times in milliseconds of all the
// requests in the unit.
TimeAvg uint32 | <mask> Domains []countPair
<mask> BlockedDomains []countPair
<mask> Clients []countPair
<mask>
<mask> TimeAvg uint32 // usec
<mask> }
<mask>
<mask> // withRecovered turns the value recovered from panic if any into an error and
<mask> // combines it with the one pointed by orig. orig must be non-nil.
<mask> func withRecovered(orig *error) {
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove Clients []countPair
</s> add // Clients is the number of requests from each client.
Clients []countPair </s> remove Domains []countPair
</s> add // Domains is the number of requests for each domain name.
Domains []countPair
// BlockedDomains is the number of requests blocked for each domain name. </s> remove NTotal uint64
</s> add // NTotal is the total number of requests.
NTotal uint64
// NResult is the number of requests by the result's kind. </s> remove // structure for storing data in file
</s> add // unitDB is the structure for deserializing statistics data into the database. </s> remove func (s *statsCtx) ongoing() (u *unit) {
s.mu.Lock()
defer s.mu.Unlock()
return s.current
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
// isEnabled is a helper that check if the statistics collecting is enabled.
func (s *StatsCtx) isEnabled() (ok bool) {
return atomic.LoadUint32(&s.limitHours) != 0
}
// New creates s from conf and properly initializes it. Don't use s before
// calling it's Start method.
func New(conf Config) (s *StatsCtx, err error) { | <mask>
<mask> *orig = errors.WithDeferred(*orig, err)
<mask> }
<mask>
<mask> // createObject creates s from conf and properly initializes it.
<mask> func createObject(conf Config) (s *statsCtx, err error) {
<mask> defer withRecovered(&err)
<mask>
<mask> s = &statsCtx{
<mask> mu: &sync.Mutex{},
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove s = &statsCtx{
mu: &sync.Mutex{},
</s> add s = &StatsCtx{
currMu: &sync.Mutex{},
dbMu: &sync.Mutex{},
filename: conf.Filename,
configModified: conf.ConfigModified,
httpRegister: conf.HTTPRegister, </s> remove if !checkInterval(conf.LimitDays) {
conf.LimitDays = 1
</s> add if s.limitHours = conf.LimitDays * 24; !checkInterval(conf.LimitDays) {
s.limitHours = 24 </s> remove func (s *statsCtx) Start() {
</s> add // Start makes s process the incoming data.
func (s *StatsCtx) Start() { </s> remove // name-count pair
</s> add // database returns the database if it's opened. It's safe for concurrent use.
func (s *StatsCtx) database() (db *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
return s.db
}
// swapDatabase swaps the database with another one and returns it. It's safe
// for concurrent use.
func (s *StatsCtx) swapDatabase(with *bbolt.DB) (old *bbolt.DB) {
s.dbMu.Lock()
defer s.dbMu.Unlock()
old, s.db = s.db, with
return old
}
// countPair is a single name-number pair for deserializing statistics data into
// the database. </s> remove // Delete unit's data from file
func (s *statsCtx) deleteUnit(tx *bolt.Tx, id uint32) bool {
</s> add // deleteUnit removes the unit by it's id from the database the tx belongs to.
func (s *StatsCtx) deleteUnit(tx *bbolt.Tx, id uint32) bool { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
s = &StatsCtx{
currMu: &sync.Mutex{},
dbMu: &sync.Mutex{},
filename: conf.Filename,
configModified: conf.ConfigModified,
httpRegister: conf.HTTPRegister, | <mask> // createObject creates s from conf and properly initializes it.
<mask> func createObject(conf Config) (s *statsCtx, err error) {
<mask> defer withRecovered(&err)
<mask>
<mask> s = &statsCtx{
<mask> mu: &sync.Mutex{},
<mask> }
<mask> if !checkInterval(conf.LimitDays) {
<mask> conf.LimitDays = 1
<mask> }
<mask>
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove // createObject creates s from conf and properly initializes it.
func createObject(conf Config) (s *statsCtx, err error) {
</s> add // isEnabled is a helper that check if the statistics collecting is enabled.
func (s *StatsCtx) isEnabled() (ok bool) {
return atomic.LoadUint32(&s.limitHours) != 0
}
// New creates s from conf and properly initializes it. Don't use s before
// calling it's Start method.
func New(conf Config) (s *StatsCtx, err error) { </s> remove if !checkInterval(conf.LimitDays) {
conf.LimitDays = 1
</s> add if s.limitHours = conf.LimitDays * 24; !checkInterval(conf.LimitDays) {
s.limitHours = 24 </s> remove
s.conf = &Config{}
*s.conf = conf
s.conf.limit = conf.LimitDays * 24
if conf.UnitID == nil {
s.conf.UnitID = newUnitID
</s> add if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID </s> remove func (s *statsCtx) Start() {
</s> add // Start makes s process the incoming data.
func (s *StatsCtx) Start() { </s> remove func (s *statsCtx) dbOpen() bool {
var err error
</s> add // dbOpen returns an error if the database can't be opened from the specified
// file. It's safe for concurrent use.
func (s *StatsCtx) dbOpen() (err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
if s.limitHours = conf.LimitDays * 24; !checkInterval(conf.LimitDays) {
s.limitHours = 24 | <mask>
<mask> s = &statsCtx{
<mask> mu: &sync.Mutex{},
<mask> }
<mask> if !checkInterval(conf.LimitDays) {
<mask> conf.LimitDays = 1
<mask> }
<mask>
<mask> s.conf = &Config{}
<mask> *s.conf = conf
<mask> s.conf.limit = conf.LimitDays * 24
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove
s.conf = &Config{}
*s.conf = conf
s.conf.limit = conf.LimitDays * 24
if conf.UnitID == nil {
s.conf.UnitID = newUnitID
</s> add if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID </s> remove s = &statsCtx{
mu: &sync.Mutex{},
</s> add s = &StatsCtx{
currMu: &sync.Mutex{},
dbMu: &sync.Mutex{},
filename: conf.Filename,
configModified: conf.ConfigModified,
httpRegister: conf.HTTPRegister, </s> remove // createObject creates s from conf and properly initializes it.
func createObject(conf Config) (s *statsCtx, err error) {
</s> add // isEnabled is a helper that check if the statistics collecting is enabled.
func (s *StatsCtx) isEnabled() (ok bool) {
return atomic.LoadUint32(&s.limitHours) != 0
}
// New creates s from conf and properly initializes it. Don't use s before
// calling it's Start method.
func New(conf Config) (s *StatsCtx, err error) { </s> remove func (s *statsCtx) setLimit(limitDays int) {
s.conf.limit = uint32(limitDays) * 24
</s> add func (s *StatsCtx) setLimit(limitDays int) {
atomic.StoreUint32(&s.limitHours, uint32(24*limitDays)) </s> remove func (s *statsCtx) WriteDiskConfig(dc *DiskConfig) {
dc.Interval = s.conf.limit / 24
</s> add func (s *StatsCtx) WriteDiskConfig(dc *DiskConfig) {
dc.Interval = atomic.LoadUint32(&s.limitHours) / 24 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID | <mask> }
<mask> if !checkInterval(conf.LimitDays) {
<mask> conf.LimitDays = 1
<mask> }
<mask>
<mask> s.conf = &Config{}
<mask> *s.conf = conf
<mask> s.conf.limit = conf.LimitDays * 24
<mask> if conf.UnitID == nil {
<mask> s.conf.UnitID = newUnitID
<mask> }
<mask>
<mask> if !s.dbOpen() {
<mask> return nil, fmt.Errorf("open database")
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove if !checkInterval(conf.LimitDays) {
conf.LimitDays = 1
</s> add if s.limitHours = conf.LimitDays * 24; !checkInterval(conf.LimitDays) {
s.limitHours = 24 </s> remove if !s.dbOpen() {
return nil, fmt.Errorf("open database")
</s> add if err = s.dbOpen(); err != nil {
return nil, fmt.Errorf("opening database: %w", err) </s> remove s = &statsCtx{
mu: &sync.Mutex{},
</s> add s = &StatsCtx{
currMu: &sync.Mutex{},
dbMu: &sync.Mutex{},
filename: conf.Filename,
configModified: conf.ConfigModified,
httpRegister: conf.HTTPRegister, </s> remove id := s.conf.UnitID()
tx := s.beginTxn(true)
</s> add id := s.unitIDGen()
tx := beginTxn(s.db, true) </s> remove func (s *statsCtx) setLimit(limitDays int) {
s.conf.limit = uint32(limitDays) * 24
</s> add func (s *StatsCtx) setLimit(limitDays int) {
atomic.StoreUint32(&s.limitHours, uint32(24*limitDays)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
if err = s.dbOpen(); err != nil {
return nil, fmt.Errorf("opening database: %w", err) | <mask> if conf.UnitID == nil {
<mask> s.conf.UnitID = newUnitID
<mask> }
<mask>
<mask> if !s.dbOpen() {
<mask> return nil, fmt.Errorf("open database")
<mask> }
<mask>
<mask> id := s.conf.UnitID()
<mask> tx := s.beginTxn(true)
<mask> var udb *unitDB
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove id := s.conf.UnitID()
tx := s.beginTxn(true)
</s> add id := s.unitIDGen()
tx := beginTxn(s.db, true) </s> remove
s.conf = &Config{}
*s.conf = conf
s.conf.limit = conf.LimitDays * 24
if conf.UnitID == nil {
s.conf.UnitID = newUnitID
</s> add if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID </s> remove firstID := id - s.conf.limit - 1
</s> add firstID := id - s.limitHours - 1 </s> remove nu := unit{}
s.initUnit(&nu, id)
u := s.swapUnit(&nu)
udb := serialize(u)
</s> add nu := newUnit(id)
u := s.swapCurrent(nu)
udb := u.serialize() </s> remove func (s *statsCtx) loadUnitFromDB(tx *bolt.Tx, id uint32) *unitDB {
</s> add func (s *StatsCtx) loadUnitFromDB(tx *bbolt.Tx, id uint32) *unitDB { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
id := s.unitIDGen()
tx := beginTxn(s.db, true) | <mask> if !s.dbOpen() {
<mask> return nil, fmt.Errorf("open database")
<mask> }
<mask>
<mask> id := s.conf.UnitID()
<mask> tx := s.beginTxn(true)
<mask> var udb *unitDB
<mask> if tx != nil {
<mask> log.Tracef("Deleting old units...")
<mask> firstID := id - s.conf.limit - 1
<mask> unitDel := 0
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove firstID := id - s.conf.limit - 1
</s> add firstID := id - s.limitHours - 1 </s> remove if !s.dbOpen() {
return nil, fmt.Errorf("open database")
</s> add if err = s.dbOpen(); err != nil {
return nil, fmt.Errorf("opening database: %w", err) </s> remove curID := cur.id
</s> add var curID uint32
if cur != nil {
curID = atomic.LoadUint32(&cur.id)
} else {
curID = s.unitIDGen()
} </s> remove
s.conf = &Config{}
*s.conf = conf
s.conf.limit = conf.LimitDays * 24
if conf.UnitID == nil {
s.conf.UnitID = newUnitID
</s> add if s.unitIDGen = newUnitID; conf.UnitID != nil {
s.unitIDGen = conf.UnitID </s> remove func (s *statsCtx) Close() {
u := s.swapUnit(nil)
udb := serialize(u)
tx := s.beginTxn(true)
if tx != nil {
if s.flushUnitToDB(tx, u.id, udb) {
</s> add func (s *StatsCtx) Close() {
u := s.swapCurrent(nil)
db := s.database()
if tx := beginTxn(db, true); tx != nil {
udb := u.serialize()
if flushUnitToDB(tx, u.id, udb) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
firstID := id - s.limitHours - 1 | <mask> tx := s.beginTxn(true)
<mask> var udb *unitDB
<mask> if tx != nil {
<mask> log.Tracef("Deleting old units...")
<mask> firstID := id - s.conf.limit - 1
<mask> unitDel := 0
<mask>
<mask> err = tx.ForEach(newBucketWalker(tx, &unitDel, firstID))
<mask> if err != nil && !errors.Is(err, errStop) {
<mask> log.Debug("stats: deleting units: %s", err)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove id := s.conf.UnitID()
tx := s.beginTxn(true)
</s> add id := s.unitIDGen()
tx := beginTxn(s.db, true) </s> remove if !s.dbOpen() {
return nil, fmt.Errorf("open database")
</s> add if err = s.dbOpen(); err != nil {
return nil, fmt.Errorf("opening database: %w", err) </s> remove log.Error("db.Begin: %s", err)
</s> add log.Error("stats: opening a transaction: %s", err)
</s> remove func (s *statsCtx) Close() {
u := s.swapUnit(nil)
udb := serialize(u)
tx := s.beginTxn(true)
if tx != nil {
if s.flushUnitToDB(tx, u.id, udb) {
</s> add func (s *StatsCtx) Close() {
u := s.swapCurrent(nil)
db := s.database()
if tx := beginTxn(db, true); tx != nil {
udb := u.serialize()
if flushUnitToDB(tx, u.id, udb) { </s> remove ) (f func(name []byte, b *bolt.Bucket) (err error)) {
return func(name []byte, _ *bolt.Bucket) (err error) {
</s> add ) (f func(name []byte, b *bbolt.Bucket) (err error)) {
return func(name []byte, _ *bbolt.Bucket) (err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
u := newUnit(id)
// This use of deserialize is safe since the accessed unit has just been
// created.
u.deserialize(udb)
s.curr = u | <mask> }
<mask> }
<mask> }
<mask>
<mask> u := unit{}
<mask> s.initUnit(&u, id)
<mask> if udb != nil {
<mask> deserialize(&u, udb)
<mask> }
<mask> s.current = &u
<mask>
<mask> log.Debug("stats: initialized")
<mask>
<mask> return s, nil
<mask> }
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove nu := unit{}
s.initUnit(&nu, id)
u := s.swapUnit(&nu)
udb := serialize(u)
</s> add nu := newUnit(id)
u := s.swapCurrent(nu)
udb := u.serialize() </s> remove func (s *statsCtx) Close() {
u := s.swapUnit(nil)
udb := serialize(u)
tx := s.beginTxn(true)
if tx != nil {
if s.flushUnitToDB(tx, u.id, udb) {
</s> add func (s *StatsCtx) Close() {
u := s.swapCurrent(nil)
db := s.database()
if tx := beginTxn(db, true); tx != nil {
udb := u.serialize()
if flushUnitToDB(tx, u.id, udb) { </s> remove u := unit{}
s.initUnit(&u, s.conf.UnitID())
_ = s.swapUnit(&u)
</s> add u := newUnit(s.unitIDGen())
_ = s.swapCurrent(u) </s> remove err := os.Remove(s.conf.Filename)
</s> add err := os.Remove(s.filename) </s> remove s.mu.Lock()
defer s.mu.Unlock()
</s> add u := s.ongoing()
if u == nil {
return
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
tx *bbolt.Tx, | <mask> // newBucketWalker returns a new bucket walker that deletes old units. The
<mask> // integer that unitDelPtr points to is incremented for every successful
<mask> // deletion. If the bucket isn't deleted, f returns errStop.
<mask> func newBucketWalker(
<mask> tx *bolt.Tx,
<mask> unitDelPtr *int,
<mask> firstID uint32,
<mask> ) (f func(name []byte, b *bolt.Bucket) (err error)) {
<mask> return func(name []byte, _ *bolt.Bucket) (err error) {
<mask> nameID, ok := unitNameToID(name)
</s> Pull request: 4358 fix stats
Merge in DNS/adguard-home from 4358-fix-stats to master
Updates #4358.
Updates #4342.
Squashed commit of the following:
commit 5683cb304688ea639e5ba7f219a7bf12370211a4
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 18:20:54 2022 +0300
stats: rm races test
commit 63dd67650ed64eaf9685b955a4fdf3c0067a7f8c
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 17:13:36 2022 +0300
stats: try to imp test
commit 59a0f249fc00566872db62e362c87bc0c201b333
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 16:38:57 2022 +0300
stats: fix nil ptr deref
commit 7fc3ff18a34a1d0e0fec3ca83a33f499ac752572
Author: Eugene Burkov <[email protected]>
Date: Thu Apr 7 16:02:51 2022 +0300
stats: fix races finally, imp tests
commit c63f5f4e7929819fe79b3a1e392f6b91cd630846
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:56:49 2022 +0300
aghhttp: add register func
commit 61adc7f0e95279c1b7f4a0c0af5ab387ee461411
Merge: edbdb2d4 9b3adac1
Author: Eugene Burkov <[email protected]>
Date: Thu Aug 4 00:36:01 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit edbdb2d4c6a06dcbf8107a28c4c3a61ba394e907
Merge: a91e4d7a a481ff4c
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 21:00:42 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit a91e4d7af13591eeef45cb7980d1ebc1650a5cb7
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:46:19 2022 +0300
stats: imp code, docs
commit c5f3814c5c1a734ca8ff6726cc9ffc1177a055cf
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:16:13 2022 +0300
all: log changes
commit 5e6caafc771dddc4c6be07c34658de359106fbe5
Merge: 091ba756 eb8e8166
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:09:10 2022 +0300
Merge branch 'master' into 4358-fix-stats
commit 091ba75618d3689b9c04f05431283417c8cc52f9
Author: Eugene Burkov <[email protected]>
Date: Wed Aug 3 18:07:39 2022 +0300
stats: imp docs, code
commit f2b2de77ce5f0448d6df9232a614a3710f1e2e8a
Author: Eugene Burkov <[email protected]>
Date: Tue Aug 2 17:09:30 2022 +0300
all: refactor stats & add mutexes
commit b3f11c455ceaa3738ec20eefc46f866ff36ed046
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 27 15:30:09 2022 +0300
WIP </s> remove ) (f func(name []byte, b *bolt.Bucket) (err error)) {
return func(name []byte, _ *bolt.Bucket) (err error) {
</s> add ) (f func(name []byte, b *bbolt.Bucket) (err error)) {
return func(name []byte, _ *bbolt.Bucket) (err error) { </s> remove // Open a DB transaction
func (s *statsCtx) beginTxn(wr bool) *bolt.Tx {
db := s.db
</s> add // beginTxn opens a new database transaction. If writable is true, the
// transaction will be opened for writing, and for reading otherwise. It
// returns nil if the transaction can't be created.
func beginTxn(db *bbolt.DB, writable bool) (tx *bbolt.Tx) { </s> remove func (s *statsCtx) ongoing() (u *unit) {
s.mu.Lock()
defer s.mu.Unlock()
return s.current
}
</s> add </s> remove type unitIDCallback func() uint32
</s> add // UnitIDGenFunc is the signature of a function that generates a unique ID for
// the statistics unit.
type UnitIDGenFunc func() (id uint32) </s> remove return name
</s> add return n[:] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/4293cf5945a9331fd8ce1eb33a88865c6b8713cc | internal/stats/unit.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.