Skip to content

Commit

Permalink
Merge branch 'main' into issue-18035-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
sonika-shah committed Sep 30, 2024
2 parents 5d32482 + 9552886 commit 250b009
Show file tree
Hide file tree
Showing 18 changed files with 211 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Database service setup
slug: /how-to-guides/getting-started/day-1/database-service-setup
collate: true
---

## Setting Up a Database Service for Metadata Extraction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Day 1
slug: /how-to-guides/getting-started/day-1
collate: true
---

# Getting Started: Day 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /how-to-guides/getting-started

Welcome to OpenMetadata's unified platform for data discovery, observability, and governance. Our platform centralizes all data context to help you build high-quality data and AI assets. This guide provides the necessary information to set up your OpenMetadata environment in 30 minutes.

## How Does Collate Work?
## How Does OpenMetadata Work?

OpenMetadata is designed to support both technical and non-technical data practitioners across various use cases, including data discovery, lineage, observability, quality, collaboration, governance, and insights.

Expand All @@ -18,7 +18,7 @@ The platform’s native collaboration features support shared workflows, enablin

## Key Features of OpenMetadata

Before we get started, here’s a quick summary of some of Collate’s main features:
Before we get started, here’s a quick summary of some of OpenMetadata’s main features:

### Discovery
- Integrated catalog, data quality, and glossary
Expand Down
13 changes: 13 additions & 0 deletions openmetadata-docs/content/v1.5.x/how-to-guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ slug: /how-to-guides

# How-to Guides

## Getting Started

Set up and explore OpenMetadata's core features, from basic configuration to advanced functionalities, for a seamless onboarding experience.

{% tilesContainer %}
{% tile
title="Getting Started"
description="Unlock metadata insights for informed business decisions."
link="/how-to-guides/getting-started"
icon="discovery"
/%}
{% /tilesContainer %}

The How-to Guides will give you a walk through on accomplishing the basic to the most advanced things in OpenMetadata. These step-by-step guides will help get an overview of the features and also help explore the various functionalities.

## Features in OpenMetadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Database service setup
slug: /how-to-guides/getting-started/day-1/database-service-setup
collate: true
---

## Setting Up a Database Service for Metadata Extraction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Day 1
slug: /how-to-guides/getting-started/day-1
collate: true
---

# Getting Started: Day 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /how-to-guides/getting-started

Welcome to OpenMetadata's unified platform for data discovery, observability, and governance. Our platform centralizes all data context to help you build high-quality data and AI assets. This guide provides the necessary information to set up your OpenMetadata environment in 30 minutes.

## How Does Collate Work?
## How Does OpenMetadata Work?

OpenMetadata is designed to support both technical and non-technical data practitioners across various use cases, including data discovery, lineage, observability, quality, collaboration, governance, and insights.

Expand All @@ -18,7 +18,7 @@ The platform’s native collaboration features support shared workflows, enablin

## Key Features of OpenMetadata

Before we get started, here’s a quick summary of some of Collate’s main features:
Before we get started, here’s a quick summary of some of OpenMetadata’s main features:

### Discovery
- Integrated catalog, data quality, and glossary
Expand Down
13 changes: 13 additions & 0 deletions openmetadata-docs/content/v1.6.x-SNAPSHOT/how-to-guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ slug: /how-to-guides

# How-to Guides

## Getting Started

Set up and explore OpenMetadata's core features, from basic configuration to advanced functionalities, for a seamless onboarding experience.

{% tilesContainer %}
{% tile
title="Getting Started"
description="Unlock metadata insights for informed business decisions."
link="/how-to-guides/getting-started"
icon="discovery"
/%}
{% /tilesContainer %}

The How-to Guides will give you a walk through on accomplishing the basic to the most advanced things in OpenMetadata. These step-by-step guides will help get an overview of the features and also help explore the various functionalities.

## Features in OpenMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4374,6 +4374,12 @@ default String getTimeSeriesTableName() {
+ "WHERE stateId = :stateId ORDER BY timestamp DESC")
List<String> listTestCaseResolutionStatusesForStateId(@Bind("stateId") String stateId);

@SqlQuery(
value =
"SELECT json FROM test_case_resolution_status_time_series "
+ "WHERE stateId = :stateId ORDER BY timestamp ASC LIMIT 1")
String listFirstTestCaseResolutionStatusesForStateId(@Bind("stateId") String stateId);

@SqlUpdate(
"DELETE FROM test_case_resolution_status_time_series WHERE entityFQNHash = :entityFQNHash")
void delete(@BindFQN("entityFQNHash") String entityFQNHash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.openmetadata.schema.entity.teams.User;
import org.openmetadata.schema.tests.TestCase;
import org.openmetadata.schema.tests.type.Assigned;
import org.openmetadata.schema.tests.type.Metric;
import org.openmetadata.schema.tests.type.Resolved;
import org.openmetadata.schema.tests.type.Severity;
import org.openmetadata.schema.tests.type.TestCaseResolutionStatus;
Expand All @@ -49,6 +50,8 @@
public class TestCaseResolutionStatusRepository
extends EntityTimeSeriesRepository<TestCaseResolutionStatus> {
public static final String COLLECTION_PATH = "/v1/dataQuality/testCases/testCaseIncidentStatus";
public static final String TIME_TO_RESPONSE = "timeToResponse";
public static final String TIME_TO_RESOLUTION = "timeToResolution";

public TestCaseResolutionStatusRepository() {
super(
Expand All @@ -75,6 +78,21 @@ public ResultList<TestCaseResolutionStatus> listTestCaseResolutionStatusesForSta
return getResultList(testCaseResolutionStatuses, null, null, testCaseResolutionStatuses.size());
}

private TestCaseResolutionStatus listFirstTestCaseResolutionStatusForStateId(UUID stateId) {
String json =
((CollectionDAO.TestCaseResolutionStatusTimeSeriesDAO) timeSeriesDao)
.listFirstTestCaseResolutionStatusesForStateId(stateId.toString());

if (json == null) {
return null;
}

TestCaseResolutionStatus testCaseResolutionStatus =
JsonUtils.readValue(json, TestCaseResolutionStatus.class);
setInheritedFields(testCaseResolutionStatus);
return testCaseResolutionStatus;
}

public RestUtil.PatchResponse<TestCaseResolutionStatus> patch(
UUID id, JsonPatch patch, String user)
throws IntrospectionException, InvocationTargetException, IllegalAccessException {
Expand Down Expand Up @@ -190,6 +208,7 @@ public void storeInternal(
: recordEntity.getSeverity());
}

setResolutionMetrics(lastIncident, recordEntity);
inferIncidentSeverity(recordEntity);

switch (recordEntity.getTestCaseResolutionStatusType()) {
Expand Down Expand Up @@ -438,4 +457,35 @@ protected static UUID getOrCreateIncident(TestCase testCase, String updatedBy) {

return incident.getStateId();
}

private void setResolutionMetrics(
TestCaseResolutionStatus lastIncident, TestCaseResolutionStatus newIncident) {
List<Metric> metrics = new ArrayList<>();
if (lastIncident == null) return;

if (lastIncident.getTestCaseResolutionStatusType().equals(TestCaseResolutionStatusTypes.New)
&& !newIncident
.getTestCaseResolutionStatusType()
.equals(TestCaseResolutionStatusTypes.Resolved)) {
// Time to response is New (1st step in the workflow) -> [Any status but Resolved (Last step
// in the workflow)]
long timeToResponse = newIncident.getTimestamp() - lastIncident.getTimestamp();
Metric metric = new Metric().withName(TIME_TO_RESPONSE).withValue((double) timeToResponse);
metrics.add(metric);
}

if (newIncident
.getTestCaseResolutionStatusType()
.equals(TestCaseResolutionStatusTypes.Resolved)) {
TestCaseResolutionStatus firstIncidentInWorkflow =
listFirstTestCaseResolutionStatusForStateId(newIncident.getStateId());
if (firstIncidentInWorkflow != null) {
long timeToResolution = newIncident.getTimestamp() - firstIncidentInWorkflow.getTimestamp();
Metric metric =
new Metric().withName(TIME_TO_RESOLUTION).withValue((double) timeToResolution);
metrics.add(metric);
}
}
if (!metrics.isEmpty()) newIncident.setMetrics(metrics);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,23 @@
}
}
},
"metrics": {
"type": "nested",
"properties": {
"name": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"value": {
"type": "float"
}
}
},
"updatedBy": {
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@
}
}
},
"metrics": {
"type": "nested",
"properties": {
"name": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"value": {
"type": "float"
}
}
},
"updatedBy": {
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,23 @@
}
}
},
"metrics": {
"type": "nested",
"properties": {
"name": {
"type": "keyword",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"value": {
"type": "float"
}
}
},
"updatedBy": {
"properties": {
"id": {
Expand Down
Loading

0 comments on commit 250b009

Please sign in to comment.