forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(model): dashboard usage model, is_null condition added (datahub-…
- Loading branch information
1 parent
4c38045
commit 5ad3bb1
Showing
17 changed files
with
1,489 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
350 changes: 350 additions & 0 deletions
350
...in/java/com/linkedin/datahub/graphql/resolvers/dashboard/DashboardUsageStatsResolver.java
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
...java/com/linkedin/datahub/graphql/types/dashboard/mappers/DashboardUsageMetricMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.linkedin.datahub.graphql.types.dashboard.mappers; | ||
|
||
import com.linkedin.datahub.graphql.generated.DashboardUsageMetrics; | ||
import com.linkedin.datahub.graphql.types.mappers.TimeSeriesAspectMapper; | ||
import com.linkedin.metadata.aspect.EnvelopedAspect; | ||
import com.linkedin.metadata.utils.GenericRecordUtils; | ||
import javax.annotation.Nonnull; | ||
|
||
|
||
public class DashboardUsageMetricMapper implements TimeSeriesAspectMapper<DashboardUsageMetrics> { | ||
|
||
public static final DashboardUsageMetricMapper INSTANCE = new DashboardUsageMetricMapper(); | ||
|
||
public static DashboardUsageMetrics map(@Nonnull final EnvelopedAspect envelopedAspect) { | ||
return INSTANCE.apply(envelopedAspect); | ||
} | ||
|
||
@Override | ||
public DashboardUsageMetrics apply(EnvelopedAspect envelopedAspect) { | ||
com.linkedin.dashboard.DashboardUsageStatistics gmsDashboardUsageStatistics = | ||
GenericRecordUtils.deserializeAspect(envelopedAspect.getAspect().getValue(), | ||
envelopedAspect.getAspect().getContentType(), com.linkedin.dashboard.DashboardUsageStatistics.class); | ||
|
||
final com.linkedin.datahub.graphql.generated.DashboardUsageMetrics dashboardUsageMetrics = | ||
new com.linkedin.datahub.graphql.generated.DashboardUsageMetrics(); | ||
dashboardUsageMetrics.setLastViewed(gmsDashboardUsageStatistics.getLastViewedAt()); | ||
dashboardUsageMetrics.setViewsCount(gmsDashboardUsageStatistics.getViewsCount()); | ||
dashboardUsageMetrics.setExecutionsCount(gmsDashboardUsageStatistics.getExecutionsCount()); | ||
dashboardUsageMetrics.setFavoritesCount(gmsDashboardUsageStatistics.getFavoritesCount()); | ||
dashboardUsageMetrics.setTimestampMillis(gmsDashboardUsageStatistics.getTimestampMillis()); | ||
|
||
return dashboardUsageMetrics; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.