Skip to content

Commit e4d0247

Browse files
committed
created a readme
1 parent cd28a00 commit e4d0247

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# MongoDB healthcheck
2+
![Release](https://github.com/instant-solutions/mongo-healthcheck/actions/workflows/release.yml/badge.svg)
3+
![Test](https://github.com/instant-solutions/mongo-healthcheck/actions/workflows/tests.yml/badge.svg)
4+
5+
Run performant and efficient MongoDB healthchecks without using the `mongosh` command. The `mongo` command line tool was marked as deprecated and removed since version 6. As a replacement `mongosh` was introduced, which is too [inefficient](https://jira.mongodb.org/browse/MONGOSH-1240) for healthchecks.
6+
7+
## Introduction
8+
9+
The command connects to the specified database and executes a `ping` command comparable to `mongosh --eval="db.adminCommand(\"ping\")"`.
10+
11+
```
12+
$ ./mongo-healthcheck --help
13+
Usage of ./mongo-healthcheck:
14+
-uri string
15+
MongoDB connection string (default "mongodb://localhost:27017")
16+
```
17+
18+
## Performance
19+
20+
### mongo-healthcheck
21+
22+
```
23+
$ time mongo-healthcheck
24+
Successfully pinged MongoDB.
25+
26+
real 0m0.013s
27+
user 0m0.006s
28+
sys 0m0.005s
29+
```
30+
31+
### mongosh
32+
33+
```
34+
$ time mongosh --eval="db.adminCommand(\"ping\")"
35+
36+
{ ok: 1 }
37+
38+
real 0m0.630s
39+
user 0m0.615s
40+
sys 0m0.078s
41+
```
42+
43+
### mongo
44+
45+
```
46+
$ time mongo --eval="db.adminCommand(\"ping\")"
47+
48+
{ "ok" : 1 }
49+
50+
real 0m0.065s
51+
user 0m0.044s
52+
sys 0m0.020s
53+
```
54+
55+
## Contribution
56+
57+
Feel free to fork the project and send us a pull-request! :sunglasses:
58+
59+
Or consider sponsoring us, so we can continue to work on this project: [GitHub Sponsors](https://github.com/sponsors/instant-solutions) :star_struck:
60+
61+
## Author
62+
63+
Made with :heart: in Austria by [instant:solutions OG](https://instant-it.at)

0 commit comments

Comments
 (0)