This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can pass `execution_options` such as https://github.com/googleapis/python-spanner-sqlalchemy#stale-reads. | |
# You don't need to set them while creating the Spanner db instance. | |
def foo(): | |
with engines.get_engine('purchase').execution_options(read_only=True).connect() as conn: | |
reseller_thresholds = zsql( | |
conn, | |
''' | |
SELECT | |
p.ref_type, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
p.ref_type, | |
p.ref_code, | |
p.sku, | |
rt.id_product_fulltype, | |
rt.sku_category, | |
COALESCE(ANY_VALUE(rt.threshold), rp.default_threshold) AS threshold, | |
SUM(item_status) AS purchased_count | |
FROM reseller.purchase_history p | |
LEFT JOIN reseller.reseller_sku_category rsc ON rsc.sku = p.value_code AND 'sku' = p.value_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handle Throttling Values and restrict accessing when throttling | |
* value exceeded. | |
* | |
* This class implementation is inspired from Redis | |
* Refer: http://redis.io/commands/incr#pattern-rate-limiter-1 | |
* | |
* Gihan Karunarathne <[email protected]> | |
*/ | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from idlelib.PyShell import main | |
if __name__ == '__main__': | |
main() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() { | |
var self = this; | |
var url = apiUrl + "/containers/" + containerId + "/stats"; | |
// var url = "/docker/containers/" + containerId + "/stats"; | |
console.log('URL ', url); | |
oboe(url) | |
.node('*', function(data) { | |
console.log('Data ', data); | |
}) |