4
* Copyright (C) 2008 10gen Inc.
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Affero General Public License, version 3,
8
* as published by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
bool Database::_openAllFiles = false;
27
bool Database::setProfilingLevel( int newLevel , string& errmsg ){
28
if ( profile == newLevel )
31
if ( newLevel < 0 || newLevel > 2 ){
32
errmsg = "profiling level has to be >=0 and <= 2";
41
assert( cc().database() == this );
43
if ( ! namespaceIndex.details( profileName.c_str() ) ){
44
log(1) << "creating profile ns: " << profileName << endl;
46
spec.appendBool( "capped", true );
47
spec.append( "size", 131072.0 );
48
if ( ! userCreateNS( profileName.c_str(), spec.done(), errmsg , true ) ){
56
void Database::finishInit(){
57
if ( cmdLine.defaultProfile == profile )
61
massert( 12506 , errmsg , setProfilingLevel( cmdLine.defaultProfile , errmsg ) );