Commit 56179c97 authored by Vaastav Anand's avatar Vaastav Anand

Add instrumentation for MovieReviewHandler

parent 0e12f212
......@@ -122,7 +122,7 @@ void MovieIdHandler::UploadMovieId(
LOG(debug) << "Get movie_id " << movie_id_mmc
<< " cache hit from Memcached";
movie_id_str = std::string(movie_id_mmc);
XTRACE("Cache hit in Memcached for movie_id " + std::to_string(movie_id_mmc));
XTRACE("Cache hit in Memcached for movie_id " + std::string(movie_id_mmc));
free(movie_id_mmc);
}
......@@ -231,7 +231,7 @@ void MovieIdHandler::UploadMovieId(
if (memcached_rc != MEMCACHED_SUCCESS) {
LOG(warning) << "Failed to set movie_id to Memcached: "
<< memcached_strerror(memcached_client, memcached_rc);
XTRACE("Failed to set movie_id to Memcached: " + memcached_strerror(memcached_client, memcached_rc));
XTRACE("Failed to set movie_id to Memcached: " + std::string(memcached_strerror(memcached_client, memcached_rc)));
}
memcached_pool_push(_memcached_client_pool, memcached_client);
});
......
......@@ -169,7 +169,7 @@ void MovieInfoHandler::WriteMovieInfo(
if (!plotinsert) {
LOG(error) << "Error: Failed to insert movie-info to MongoDB: "
<< error.message;
XTRACE("Error: Failed to insert movie-info to MongoDB " + error.message);
XTRACE("Error: Failed to insert movie-info to MongoDB " + std::string(error.message));
ServiceException se;
se.errorCode = ErrorCode::SE_MONGODB_ERROR;
se.message = error.message;
......@@ -250,7 +250,7 @@ void MovieInfoHandler::ReadMovieInfo(
if (movie_info_mmc) {
LOG(debug) << "Get movie-info " << movie_id << " cache hit from Memcached";
XTRACE("Cache hit in Memcached for movie " + std::to_string(movie_id));
XTRACE("Cache hit in Memcached for movie " + movie_id);
json movie_info_json = json::parse(std::string(
movie_info_mmc, movie_info_mmc + movie_info_mmc_size));
_return.movie_id = movie_info_json["movie_id"];
......@@ -324,7 +324,7 @@ void MovieInfoHandler::ReadMovieInfo(
throw se;
} else {
LOG(warning) << "Movie_id: " << movie_id << " doesn't exist in MongoDB";
XTRACE("Movie_id: " + std::to_string(movie_id) + " doesn't exist in MongoDB");
XTRACE("Movie_id: " + movie_id + " doesn't exist in MongoDB");
bson_destroy(query);
mongoc_cursor_destroy(cursor);
mongoc_collection_destroy(collection);
......@@ -336,7 +336,7 @@ void MovieInfoHandler::ReadMovieInfo(
}
} else {
LOG(debug) << "Movie_id: " << movie_id << " found in MongoDB";
XTRACE("Movie_id: " + std::to_string(movie_id) + " found in MongoDB");
XTRACE("Movie_id: " + movie_id + " found in MongoDB");
auto movie_info_json_char = bson_as_json(doc, nullptr);
json movie_info_json = json::parse(movie_info_json_char);
_return.movie_id = movie_info_json["movie_id"];
......@@ -499,7 +499,7 @@ void MovieInfoHandler::UpdateRating(
if (!updated) {
LOG(error) << "Failed to update rating for movie " << movie_id
<< " to MongoDB: " << error.message;
XTRACE("Failed to update rating for movie " + std::to_string(movie_id) + " to MongoDB");
XTRACE("Failed to update rating for movie " + movie_id + " to MongoDB");
ServiceException se;
se.errorCode = ErrorCode::SE_MONGODB_ERROR;
se.message = "Failed to update rating for movie " + movie_id +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment