-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC Couch Stats Resource Tracker for tracking process local resource usage #4812
base: main
Are you sure you want to change the base?
Changes from all commits
be84279
e5e4820
ecda8f3
73863a7
12e0267
84be4af
19224af
cafa512
996c385
1bbf7a9
e70ba4d
715b524
be8ab04
4c05a0f
eb20b5d
f4a712c
c758cb7
4f00910
887a7f2
1a1a584
db1f874
50495bf
9578773
f77583a
ac17510
c500f0f
d7e9bd9
f68005a
0371589
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
setup() -> | ||
Hashed = couch_passwords:hash_admin_password(?PASS), | ||
ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist = false), | ||
ok = config:set("couchdb", "max_document_size", "50"), | ||
ok = config:set("couchdb", "max_document_size", "50", false), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
TmpDb = ?tempdb(), | ||
Addr = config:get("chttpd", "bind_address", "127.0.0.1"), | ||
Port = mochiweb_socket_server:get(chttpd, port), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,7 @@ open_doc(Db, IdOrDocInfo) -> | |
open_doc(Db, IdOrDocInfo, []). | ||
|
||
open_doc(Db, Id, Options) -> | ||
%% TODO: wire in csrt tracking | ||
increment_stat(Db, [couchdb, database_reads]), | ||
case open_doc_int(Db, Id, Options) of | ||
{ok, #doc{deleted = true} = Doc} -> | ||
|
@@ -1982,6 +1983,7 @@ increment_stat(#db{options = Options}, Stat, Count) when | |
-> | ||
case lists:member(sys_db, Options) of | ||
true -> | ||
%% TODO: we shouldn't leak resource usage just because it's a sys_db | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrmm. How we can do it? Are you planing to store Final solution to this question is out of scope for the first PR. TODO is good enough for first version of the feature. |
||
ok; | ||
false -> | ||
couch_stats:increment_counter(Stat, Count) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is fine IMO