Browse Source

remove microtime module

pull/319/head
Peter Johnson 9 years ago
parent
commit
b5b3c41ba1
  1. 1
      package.json
  2. 7
      service/mget.js
  3. 5
      service/search.js

1
package.json

@ -47,7 +47,6 @@
"iso3166-1": "^0.2.3", "iso3166-1": "^0.2.3",
"lodash": "^3.10.1", "lodash": "^3.10.1",
"markdown": "0.5.0", "markdown": "0.5.0",
"microtime": "1.4.0",
"morgan": "1.5.2", "morgan": "1.5.2",
"pelias-config": "^1.0.1", "pelias-config": "^1.0.1",
"pelias-esclient": "0.0.25", "pelias-esclient": "0.0.25",

7
service/mget.js

@ -12,7 +12,6 @@
**/ **/
var peliasLogger = require( 'pelias-logger' ).get( 'service/mget' ); var peliasLogger = require( 'pelias-logger' ).get( 'service/mget' );
var microtime = require( 'microtime' );
function service( backend, query, cb ){ function service( backend, query, cb ){
@ -22,11 +21,9 @@ function service( backend, query, cb ){
docs: query docs: query
} }
}; };
var startTime = microtime.nowDouble();
// query new backend // query new backend
backend().client.mget( cmd, function( err, data ){ backend().client.mget( cmd, function( err, data ){
peliasLogger.verbose( 'time elasticsearch query took:', microtime.nowDouble() - startTime );
// handle backend errors // handle backend errors
if( err ){ return cb( err ); } if( err ){ return cb( err ); }
@ -39,7 +36,7 @@ function service( backend, query, cb ){
// remove docs not actually found // remove docs not actually found
return doc.found; return doc.found;
}).map( function( doc ){ }).map( function( doc ){
// map metadata in to _source so we // map metadata in to _source so we

5
service/search.js

@ -6,14 +6,11 @@
**/ **/
var peliasLogger = require( 'pelias-logger' ).get( 'service/search' ); var peliasLogger = require( 'pelias-logger' ).get( 'service/search' );
var microtime = require( 'microtime' );
function service( backend, cmd, cb ){ function service( backend, cmd, cb ){
var startTime = microtime.nowDouble();
// query new backend // query new backend
backend().client.search( cmd, function( err, data ){ backend().client.search( cmd, function( err, data ){
peliasLogger.verbose( 'time elasticsearch query took:', microtime.nowDouble() - startTime );
// handle backend errors // handle backend errors
if( err ){ return cb( err ); } if( err ){ return cb( err ); }

Loading…
Cancel
Save