simple js benchmakring harness

This commit is contained in:
Eliot Horowitz
2010-09-14 18:53:09 -04:00
parent 57c2cf9b01
commit 3db3cb13dc
3 changed files with 183 additions and 1 deletions

View File

@@ -23,6 +23,8 @@
namespace mongo {
void installBenchmarkSystem( Scope& scope );
BSONObj jsmd5( const BSONObj &a ){
uassert( 10261 , "js md5 needs a string" , a.firstElement().type() == String );
const char * s = a.firstElement().valuestrsafe();
@@ -43,9 +45,16 @@ namespace mongo {
return BSONObj();
}
// ---------------------------------
// ---- installer --------
// ---------------------------------
void installGlobalUtils( Scope& scope ){
scope.injectNative( "hex_md5" , jsmd5 );
scope.injectNative( "version" , JSVersion );
installBenchmarkSystem( scope );
}
}