Skip to content

Commit

Permalink
Fix system stats with MongoDB >= 4.4 (#11357)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed Sep 28, 2021
1 parent 96008c1 commit 28b3287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -49,7 +49,8 @@ public abstract class DatabaseStats {
public abstract long storageSize();

@JsonProperty
public abstract long numExtents();
@Nullable
public abstract Long numExtents();

@JsonProperty
public abstract long indexes();
Expand Down Expand Up @@ -79,7 +80,7 @@ public static DatabaseStats create(String db,
double avgObjSize,
long dataSize,
long storageSize,
long numExtents,
@Nullable Long numExtents,
long indexes,
long indexSize,
@Nullable Long fileSize,
Expand Down
Expand Up @@ -173,7 +173,7 @@ public MongoStats mongoStats() {
dbStatsResult.getDouble("avgObjSize"),
dbStatsResult.getLong("dataSize"),
dbStatsResult.getLong("storageSize"),
dbStatsResult.getLong("numExtents"),
dbStatsResult.containsField("numExtents") ? dbStatsResult.getLong("numExtents") : null,
dbStatsResult.getLong("indexes"),
dbStatsResult.getLong("indexSize"),
dbStatsResult.containsField("fileSize") ? dbStatsResult.getLong("fileSize") : null,
Expand Down

0 comments on commit 28b3287

Please sign in to comment.