Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit b5ba486

Browse files
committed
Added 'tracking' section to README
1 parent 8ca2992 commit b5ba486

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ better than MySQL.
4646
- [How to use from Python](#how-to-use-from-python)
4747
- [Technical Explanation](#technical-explanation)
4848
- [Performance Considerations](#performance-considerations)
49+
- [Anonymous Tracking](#anonymous-tracking)
4950
- [Development Setup](#development-setup)
5051
- [License](#license)
5152

@@ -182,12 +183,12 @@ _<sup>*</sup> Some drivers have dependencies that cannot be installed using `pip
182183

183184
### Install Psycopg2
184185

185-
In order to run Postgresql, you'll need `psycopg2`. This Python package requires some additional dependencies described in their [documentation](https://www.psycopg.org/docs/install.html#build-prerequisites).
186+
In order to run Postgresql, you'll need `psycopg2`. This Python package requires some additional dependencies described in their [documentation](https://www.psycopg.org/docs/install.html#build-prerequisites).
186187
An easy solution is to install [psycopg2-binary](https://www.psycopg.org/docs/install.html#quick-install) by running:
187188

188189
```pip install psycopg2-binary```
189190

190-
Which comes with a pre-compiled binary and does not require additonal prerequisites. However, note that for production use it is adviced to use `psycopg2`.
191+
Which comes with a pre-compiled binary and does not require additonal prerequisites. However, note that for production use it is adviced to use `psycopg2`.
191192

192193

193194
# How to use
@@ -225,6 +226,8 @@ Options:
225226
- `-j` or `--threads` - Number of worker threads to use per database. Default=1.
226227
- `-w`, `--where` - An additional 'where' expression to restrict the search space.
227228
- `--conf`, `--run` - Specify the run and configuration from a TOML file. (see below)
229+
- `--no-tracking` - data-diff sends home anonymous usage data. Use this to disable it.
230+
228231

229232
### How to use with a configuration file
230233

@@ -469,6 +472,45 @@ If you pass `--stats` you'll see e.g. what % of rows were different.
469472
gaps), and improvements to bypass Python/driver performance limitations when
470473
comparing huge amounts of rows locally (i.e. for very high `bisection_threshold` values).
471474

475+
# Anonymous Tracking
476+
477+
data-diff collects anonymous usage data, in order to improve the tool, and our understanding of our user base.
478+
479+
The data is sent home once when the tool starts, and once when it ends its run.
480+
We do not collect any sensitive information.
481+
482+
The collected data is limited to:
483+
484+
- Operating System and Python version
485+
486+
- Names of databases used (postgresql, mysql, etc.)
487+
488+
- Sizes of tables used, elapsed run time, and diff count. (numbers only)
489+
490+
- Error message, if any, truncated to the first 20 characters.
491+
492+
- A persistent UUID to indentify the session, stored in `~/.datadiff.toml`
493+
494+
If you do not wish to participate, it can be easily disabled.
495+
496+
## Disable
497+
498+
There are several ways to disable the tracking.
499+
500+
In the CLI, use the `--no-tracking` flag.
501+
502+
In the config file, set `no_tracking = true` (for example, under `[run.default]`)
503+
504+
If you're using the Python API, do the following:
505+
506+
```python
507+
import data_diff
508+
data_diff.disable_tracking() # Call this first, before making any API calls
509+
510+
# Connect and diff your tables without any tracking
511+
```
512+
513+
472514
# Development Setup
473515

474516
The development setup centers around using `docker-compose` to boot up various

data_diff/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Tuple, Iterator, Optional, Union
22

3+
from .tracking import disable_tracking
34
from .databases.connect import connect
45
from .diff_tables import (
56
TableSegment,

data_diff/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _get_schema(pair):
8383
@click.option("--json", "json_output", is_flag=True, help="Print JSONL output for machine readability")
8484
@click.option("-v", "--verbose", is_flag=True, help="Print extra info")
8585
@click.option("-i", "--interactive", is_flag=True, help="Confirm queries, implies --debug")
86-
@click.option("--no-tracking", is_flag=True, help="Disable anonymous tracking.")
86+
@click.option("--no-tracking", is_flag=True, help="data-diff sends home anonymous usage data. Use this to disable it.")
8787
@click.option(
8888
"--case-sensitive",
8989
is_flag=True,

0 commit comments

Comments
 (0)