redhat-developer / vscode-redhat-telemetry

21 stars 25 forks source link

Add daily limits support for events (1 startup/day) #50

Closed fbricon closed 1 month ago

fbricon commented 2 months ago

I tested it by tweaking vscode-xml's launch config

"env": {
        "VSCODE_REDHAT_TELEMETRY_DEBUG": "true",
        "REDHAT_TELEMETRY_REMOTE_CONFIG_URL":"https://gist.githubusercontent.com/fbricon/1aa414d547554222890f960c9e682612/raw/config.json",
        "LEMMINX_DEBUG": "1"
      }
rgrunber commented 2 months ago

Tried this out with vscode-xml and the sample remote config, and it works well!

FWIW, I use something like

vscode_statedb_print ()
{ 
    if [ $# -eq 2 ]; then
        sqlite3 -line "$1" "SELECT * FROM ItemTable WHERE key=""'"${2}"'";
    else
        sqlite3 -line "$1" 'SELECT * FROM ItemTable';
    fi
}

vscode_statedb_set ()
{ 
    sqlite3 -line "${1}" "UPDATE ItemTable SET value=""'"${3}"'"" WHERE key=""'"${2}"' ;"
}

eg.

$ vscode_statedb_set state.vscdb redhat.vscode-xml '{"telemetry.events.tracking.startup":{"count":2,"lastUpdated":1716264000000}}'

to play with the database values.