Compare commits

...

6 Commits

Author SHA1 Message Date
andrewso
f5f3a4edd7 [15.10.20] Headers 2020-10-15 20:13:02 +01:00
andrewso
83841ef6b2 [14.10.20] CPU increase 2020-10-14 13:18:05 +01:00
andrewso
ef7219a952 [10.10.20] increased Resources 2020-10-11 17:53:09 +01:00
andrewso
91d65a6bfb [10.10.20] Reduced Resources 2020-10-10 23:29:26 +01:00
andrewso
5581960eee [09.10.20] Clearer Logging for tweet messages 2020-10-09 20:26:01 +01:00
andrewso
5a6cabd3db [09.10.20] Wrong Service mentioned for log 2020-10-09 18:18:49 +01:00
2 changed files with 7 additions and 6 deletions

View File

@ -64,10 +64,10 @@ spec:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
requests: requests:
cpu: 32m cpu: 64m
memory: 32Mi memory: 64Mi
limits: limits:
cpu: 75m cpu: 128m
memory: 64Mi memory: 64Mi
securityContext: securityContext:
capabilities: capabilities:

View File

@ -18,12 +18,13 @@ analyser = sentimentAnalyser.get_sentiment()
@app.route('/sentiment', methods=['GET']) @app.route('/sentiment', methods=['GET'])
def tweetPredict(): def tweetPredict():
tweet = request.args.get('tweet') tweet = request.args.get('tweet')
syncId = request.headers.get('X-CRYPTO-Sync-ID')
log("Receiving Tweet to classify {}".format(tweet), 'INFO') log("Receiving Tweet to classify [{}] for [{}]".format(tweet, syncId), 'INFO')
result = analyser.get_vader_sentiment(tweet) result = analyser.get_vader_sentiment(tweet)
log("Returning classification result of {}".format(result), 'INFO') log("Returning classification result of [{}]".format(result), 'INFO')
return json.dumps({'result': result, 'tweet': tweet}), 200, {'ContentType':'application/json'} return json.dumps({'result': result, 'tweet': tweet}), 200, {'ContentType':'application/json'}
@ -42,7 +43,7 @@ def callProbes():
if __name__ == '__main__': if __name__ == '__main__':
setup_logging() setup_logging()
log("Starting Spam Filter...", 'INFO') log("Starting Sentiment Analyser...", 'INFO')
sys.stdout.flush() sys.stdout.flush()
Thread(target=callProbes).start() Thread(target=callProbes).start()