0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/db/introspect.cpp
Eliot Horowitz 383a862ad3 Revert "added AGPL License Header to every file"
Oops - added multiple times.

This reverts commit 608769fd03.
2008-07-20 17:34:22 -04:00

40 lines
944 B
C++

// introspect.cpp
#include "stdafx.h"
#include "introspect.h"
#include "../util/builder.h"
#include "../util/goodies.h"
#include "pdfile.h"
#include "jsobj.h"
#include "pdfile.h"
typedef map<string,Cursor*> StringToCursor;
StringToCursor *specialNamespaces;
auto_ptr<Cursor> getSpecialCursor(const char *ns) {
StringToCursor::iterator it = specialNamespaces->find(ns);
return auto_ptr<Cursor>
(it == specialNamespaces->end() ?
0 : it->second->clone());
}
void SingleResultObjCursor::reg(const char *as) {
if( specialNamespaces == 0 )
specialNamespaces = new StringToCursor();
if( specialNamespaces->count(as) == 0 ) {
(*specialNamespaces)[as] = this;
}
}
void profile(const char *str,
int millis)
{
JSObjBuilder b;
b.appendDate("ts", jsTime());
b.append("info", str);
b.append("millis", (double) millis);
JSObj p = b.done();
theDataFileMgr.insert(client->profileName.c_str(),
p.objdata(), p.objsize(), true);
}