Skip to content

Commit

Permalink
Setting BG_CASSANDRA_READ_ON_SAMPLING_RATE to 0 skips updating the re…
Browse files Browse the repository at this point in the history
…ad_on
  • Loading branch information
InformatiQ authored and jfwm2 committed Apr 1, 2019
1 parent cc18e30 commit 653c711
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ This is the main backend for BigGraphite and the one that should be used in prod
- ```BG_CASSANDRA_DATA_READ_CONSISTENCY```: data read consistency (default: ```ONE```)
- ```BG_CASSANDRA_META_WRITE_CONSISTENCY```: Data write consistency (default: ```ONE```)
- ```BG_CASSANDRA_REPLICA_ID```: Identifier of this replica (default: ```0```)
- ```BG_CASSANDRA_READ_ON_SAMPLING_RATE```: Sampling rate to update metadata field ```read_on```. Setting to ```0``` disables updating ````read-on```` (default: ```0.1```)


You can also fine-tune the schema of your tables directly as needed. If you
want to active read repairs, you'll also want to set:
Expand Down
4 changes: 3 additions & 1 deletion biggraphite/drivers/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1663,8 +1663,10 @@ def _fetch_points_make_selects(self, metric_id, time_start_ms, time_end_ms, stag
return res

def _update_metric_read_on(self, metric_name):
rate = int(1 / self.__read_on_sampling_rate)
if self.__read_on_sampling_rate == 0:
return

rate = int(1 / self.__read_on_sampling_rate)
skip = self.__read_on_counter % rate > 0
self.__read_on_counter += 1

Expand Down

0 comments on commit 653c711

Please sign in to comment.