-
Notifications
You must be signed in to change notification settings - Fork 21
Importing Data
okay edited this page Jun 24, 2016
·
4 revisions
the simplest way of importing data is to send it over HTTP. Notice that samples field is a string representing an array of dictionaries.
$.post("http://your.snorkel.host/data/import", {
dataset: "mysql",
subset: "slow_queries",
samples: JSON.stringify([ // that's right, you send a JSON stringified array of samples.
{
integer: {
'query_duration': 500,
'query_count' : 10,
// this sample is actually emitted on 1 / 1000 requests,
// so we give it a 'weight' of 1000 or sample_rate of 1000
'weight' : 1000,
},
string: {
'table' : 'a_mysql_table',
'query_str' : 'select * from <TABLE>;',
'host' : 'mysql001'
},
set: {
'flags' : [
'foo', 'bar', 'baz'
]
},
}
])});
TBD
TBD