ameliabradley / wikiedit-monitor

Wikipedia monitor
3 stars 2 forks source link

Add capped collection option; refactored DB init script to give more helpful messages & run in parallel #17

Closed Barbarrosa closed 8 years ago

Barbarrosa commented 8 years ago

@leebradley Please review.

Barbarrosa commented 8 years ago

Here are some examples of what the output looks like when this executes:

Success, everything enabled:

Successfully created the capped collection "wikiedits" with the size [270000003542 bytes].
Successfully created the capped collection "errorlog" with the size [60000000 bytes].
Successfully created the capped collection "socketdata" with the size [29940000392 bytes].
Successfully created the index {"message.revision.new":1,"message.wiki":1} on the collection "socketdata".
Successfully created the index {"revnew":1,"wiki":1} on the collection "wikiedits".
Successfully created the index {"title":1,"wiki":1} on the collection "wikiedits".
MongoDB initialization completed.

Success, capped collections disabled:

Skipped creating a capped collection "wikiedits".
Skipped creating a capped collection "errorlog".
Skipped creating a capped collection "socketdata".
Successfully created the index {"revnew":1,"wiki":1} on the collection "wikiedits".
Successfully created the index {"title":1,"wiki":1} on the collection "wikiedits".
Successfully created the index {"message.revision.new":1,"message.wiki":1} on the collection "socketdata".
MongoDB initialization completed.

Partial success, capped collection config issue:

The configuration value cap_total_size is missing; it's required to create capped collections.
MongoDB initialization encountered errors: [Error: The configuration value cap_total_size is missing; it's required to create capped collections.]
The configuration value cap_total_size is missing; it's required to create capped collections.
The configuration value cap_total_size is missing; it's required to create capped collections.
Successfully created the index {"revnew":1,"wiki":1} on the collection "wikiedits".
Successfully created the index {"message.revision.new":1,"message.wiki":1} on the collection "socketdata".
Successfully created the index {"title":1,"wiki":1} on the collection "wikiedits".

Failure, connection string missing:

The configuration value conString is missing; it's required to connect to the database.
MongoDB initialization encountered errors: [Error: The configuration value conString is missing; it's required to connect to the database.]
The configuration value conString is missing; it's required to connect to the database.
The configuration value conString is missing; it's required to connect to the database.
The configuration value conString is missing; it's required to connect to the database.
The configuration value conString is missing; it's required to connect to the database.
The configuration value conString is missing; it's required to connect to the database.

Induced error after MongoDB queries finished:

There was an error creating the capped collection "wikiedits" with the size [270000003542 bytes]. [Error: Induced error]
MongoDB initialization encountered errors: [Error: Induced error]
There was an error creating the capped collection "errorlog" with the size [60000000 bytes]. [Error: Induced error]
There was an error creating the capped collection "socketdata" with the size [29940000392 bytes]. [Error: Induced error]
There was an error creating the index {"message.revision.new":1,"message.wiki":1} on the collection "socketdata". [Error: Induced error]
There was an error creating the index {"revnew":1,"wiki":1} on the collection "wikiedits". [Error: Induced error]
There was an error creating the index {"title":1,"wiki":1} on the collection "wikiedits". [Error: Induced error]
Barbarrosa commented 8 years ago

@leebradley Resolved merge conflict.