我想mongodb
使用JProfiler
. 我构建了一个简单的 groovy 脚本,它使用com.mongodb
驱动程序连接到mongodb
数据库并触发一些查询。
我按照此视频中的说明配置了 JProfiler: http ://blog.ej-technologies.com/2013/07/profiling-mongodb.html
我的脚本很简单,但是我在 JProfiler 的 mongodb 选项卡中看不到任何调用。
println "Starting client "+getName()
Mongo mongo = new Mongo("mongohost", 27017)
DB db = mongo.getDB("databasename")
// get a single collection
DBCollection collection = db.getCollection("collectionname")
DBCursor cursor = collection.find()
while (cursor.hasNext()) {
cursor.next()
}
println "Client "+getName() + " finished"
你知道我错过了什么吗?
编辑:该死的......我仔细检查了 JProfiler 文档并错过了这个条目:
MongoDB 探针与从 2.11 及更高版本开始的官方 MongoDB 驱动程序一起使用。
因此,我将 pom 中的条目更改为 2.11.3 版本,现在一切正常。