Skip to content

Commit

Permalink
Merge pull request #166 from qianmoQ/1.17.0-SNAPSHOT
Browse files Browse the repository at this point in the history
1.17.0 Released
  • Loading branch information
qianmoQ authored May 28, 2022
2 parents 3ebfe74 + 2cf3702 commit bade65d
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 64 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions docs/docs/development/version/1.17.0-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,22 @@ DBM Version for `1.17.0` is development!

---

- Support metadata management to filter the table <br />
![img.png](../../assets/images/versions/1.17.0/img.png) <br />
![img_1.png](../../assets/images/versions/1.17.0/img_1.png) <br />
![img_2.png](../../assets/images/versions/1.17.0/img_2.png) <br />
- Support trino and presto for query <br />
![img_3.png](../../assets/images/versions/1.17.0/img_3.png) <br />
- Support trino and presto for monitor --> processors <br />
- Support trino and presto for monitor --> connection <br />

#### UI

---

- Add multiple editor themes <br />
- Query the list of data sources on the page, support the display of logo <br />
![img_6.png](../../assets/images/versions/1.17.0/img_6.png) <br />

#### Optimize

----

- Optimize project description and introduction <br />
- Optimize the homepage is not available & does not support data source charts <br />
![img_4.png](../../assets/images/versions/1.17.0/img_4.png) <br />
![img_5.png](../../assets/images/versions/1.17.0/img_5.png) <br />

#### Docs

---

- Refactoring software homepage <br />

#### Bug

---

#### Contributors (In no particular order)

---

Expand Down
58 changes: 58 additions & 0 deletions docs/docs/reference/management/datasource/presto_trino.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
template: overrides/main.html
---

!!! note "Presto & Trino"

It is mainly used to describe how the software builds the Presto & Trino data source for subsequent operations.

!!! warning "System requirements"

\>= `1.17.0`

### Supported Versions

---

| Version | Tested? |
|-----------|---------------------------------------------|
| `Presto` | :material-checkbox-marked-circle:{.success} |
| `Trino` | :material-checkbox-marked-circle:{.success} |

!!! note "Supported versions"

Most versions have been tested, please submit issues for non-adapted versions.

### Created a Source

---

After entering the data source management page, click the Add data source button.

![img.png](../../../assets/images/others/management/datasource/datasource_type.png)

Select the ClickHouse icon in the `Basic` type (Presto is the second, Trino is the third).

After selecting the type, click the `Next` button at the bottom to configure the relevant information.

![img.png](../../../assets/images/others/management/datasource/presto_trino/img.png)

!!! note "Supported protocols"

- [x] `HTTP`

#### HTTP Protocol

---

!!! note "HTTP Protocol"

Use the HTTP interface provided by Presto & Trino to connect to the service.

| Parameter | Description | Required | Unique | Default |
|-------------|-----------------------------------------------------------------------------------------------------|----------|--------|---------|
| `Alias` | The alias of the data source, which will be displayed later in the selected data source on the page | Yes | Yes | |
| `Host` | The host of the Presto & Trino server | Yes | Yes | |
| `Port` | The port of the Presto & Trino server | Yes | Yes | |
| `User Name` | The user name of the Presto & Trino server | Yes | No | |
| `Password` | The password of the Presto & Trino server | Yes | No | |
59 changes: 59 additions & 0 deletions docs/docs/release/1.17.0-20220529.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
template: overrides/main.html
icon: material/gesture-tap-button
---

DBM Version for `1.17.0` is released!

Release Time: `2022-05-29`

#### Enhancement

---

- Support metadata management to filter the table <br />
![img.png](../assets/images/versions/1.17.0/img.png) <br />
![img_1.png](../assets/images/versions/1.17.0/img_1.png) <br />
![img_2.png](../assets/images/versions/1.17.0/img_2.png) <br />
- Support trino and presto for query <br />
![img_3.png](../assets/images/versions/1.17.0/img_3.png) <br />
- Support trino and presto for monitor --> processors <br />
- Support trino and presto for monitor --> connection <br />
- Support trino and presto for monitor --> slow query <br />

#### UI

---

- Add multiple editor themes <br />
- Query the list of data sources on the page, support the display of logo <br />
![img_6.png](../assets/images/versions/1.17.0/img_6.png) <br />

#### Optimize

----

- Optimize project description and introduction <br />
- Optimize the homepage is not available & does not support data source charts <br />
![img_4.png](../assets/images/versions/1.17.0/img_4.png) <br />
![img_5.png](../assets/images/versions/1.17.0/img_5.png) <br />

#### Docs

---

- Refactoring software homepage <br />
- Add clickhouse datasource docs <br />
- Add presto & trino datasource docs <br />

#### Bug

---

- Fix the exception that the data source is not selected in the track, the Track list can be selected <br />

#### Contributors (In no particular order)

---

- @qianmoQ
5 changes: 4 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ nav:
- Management:
- Datasource:
- ClickHouse: reference/management/datasource/clickhouse.md
- Presto: reference/management/datasource/presto_trino.md
- Trino: reference/management/datasource/presto_trino.md
- Monitor:
- Processor: reference/monitor/monitor-processor.md
- Connection: reference/monitor/monitor_connection.md
- Mutations: reference/monitor/monitor_mutations.md
- Query: reference/monitor/monitor_query.md
- Release Note:
- 1.16.0 (latest): release/1.16.0-20220513.md
- 1.17.0 (latest): release/1.17.0-20220529.md
- 1.16.0: release/1.16.0-20220513.md
- 1.15.0: release/1.15.0-20220425.md
- 1.14.0: release/1.14.0-20220410.md
- 1.13.0: release/1.13.0-20220329.md
Expand Down
9 changes: 7 additions & 2 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ releaseInfo:
- Support metadata management to filter the table
- Support trino and presto for query
- Support trino and presto for monitor --> processors <br />
- Support trino and presto for monitor --> connection <br />
- Support trino and presto for monitor --> processors
- Support trino and presto for monitor --> connection
- Support trino and presto for monitor --> slow query
#### Docs
---
- Refactoring software homepage
- Add clickhouse datasource docs
- Add presto & trino datasource docs
#### Optimize
Expand All @@ -32,6 +35,8 @@ releaseInfo:
---
- Fix the exception that the data source is not selected in the track, the Track list can be selected
#### UI
---
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dbm",
"version": "1.17.0-SNAPSHOT",
"version": "1.17.0",
"author": "qianmoQ <[email protected]>",
"description": "ClickHouse DataBase GUI",
"github": "https://github.com/EdurtIO/dbm.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ResponseDataModel } from '@renderer/model/response.model';
import { DatasourceService } from '@renderer/services/management/datasource.service';
import { MonitorService } from '@renderer/services/monitor/monitor.service';
import { NzMessageService } from 'ng-zorro-antd/message';
import { DatabaseEnum } from "@renderer/enum/database.enum";

@Component({
selector: 'app-monitor-query',
Expand All @@ -28,12 +27,7 @@ export class MonitorQueryComponent extends BaseComponent {
private messageService: NzMessageService) {
super();
this.datasourceService.getAll().then(response => {
this.dataSources = response.map(item => {
if (item.type === DatabaseEnum.trino || item.type === DatabaseEnum.presto) {
item.status = false;
}
return item;
});
this.dataSources = response;
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/app/pages/tools/track/track.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
nzValue="{{detail.alias}}" nzLabel="{{detail.alias}}"></nz-option>
</nz-select>
{{'common.track'|translate}}&nbsp;
<nz-select [(ngModel)]="trackId" nzAllowClear nzShowSearch nzServerSearch nzSize="small"
<nz-select [(ngModel)]="trackId" [disabled]="!datasource" nzAllowClear nzShowSearch nzServerSearch nzSize="small"
style="width: 300px;" (nzOnSearch)="handlerSearch($event)">
<ng-container *ngFor="let o of tracks">
<nz-option *ngIf="!loading.button" [nzValue]="o.value" [nzLabel]="o.value"></nz-option>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/config/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface BaseConfig {
version: string;
processesFetchAll: string;
connectionFetchAll: string;
slowQueryFetchAll: string;
diskUsedRatio: string;
databaseDiskUsedRatio: string;
tableDiskUsedRatio: string;
Expand Down
15 changes: 15 additions & 0 deletions src/renderer/config/clickhouse.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ FROM
system.processes
WHERE
round(elapsed, 1) > 0
`;
slowQueryFetchAll = `
SELECT
user, client_hostname AS host,
client_name AS hash, query AS query,
query_start_time AS time, query_duration_ms AS elapsed,
round(memory_usage / 1048576) AS memoryUsage,
result_rows AS rows, result_bytes / 1048576 AS bytes,
read_rows AS readRows, round(read_bytes / 1048576) AS bytesRead,
written_rows AS writtenRows, round(written_bytes / 1048576) AS bytesWritten
FROM system.query_log
WHERE type = 2
AND query_duration_ms >= {0}
ORDER BY query_duration_ms DESC
LIMIT 100
`;
connectionFetchAll = `
SELECT
Expand Down
12 changes: 12 additions & 0 deletions src/renderer/config/presto.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ WHERE state = 'RUNNING'
GROUP BY source
ORDER BY source DESC
`;
slowQueryFetchAll = `
SELECT
query_id AS id, now() AS time, query AS query, '0' AS rows,
(analysis_time_ms + planning_time_ms + queued_time_ms) AS elapsed,
'0' AS bytes, '0' AS memoryUsage,
'0' AS bytesRead, '0' AS bytesWritten,
'' AS hash, '' AS host
FROM system.runtime.queries
WHERE (analysis_time_ms + planning_time_ms + queued_time_ms) >= {0}
ORDER BY (analysis_time_ms + planning_time_ms + queued_time_ms) DESC
LIMIT 100
`;
columnDiskUsedRatio: string;
columnItems: string;
databaseDiskUsedRatio: string;
Expand Down
42 changes: 11 additions & 31 deletions src/renderer/services/monitor/monitor.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {BaseService} from '@renderer/services/base.service';
import {RequestModel} from '@renderer/model/request.model';
import {ResponseModel} from '@renderer/model/response.model';
import {Injectable} from '@angular/core';
import {HttpService} from '@renderer/services/http.service';
import {StringUtils} from '@renderer/utils/string.utils';
import {SshService} from '@renderer/services/ssh.service';
import {BasicService} from '@renderer/services/system/basic.service';
import {ForwardService} from '@renderer/services/forward.service';
import {FactoryService} from "@renderer/services/factory.service";
import { BaseService } from '@renderer/services/base.service';
import { RequestModel } from '@renderer/model/request.model';
import { ResponseModel } from '@renderer/model/response.model';
import { Injectable } from '@angular/core';
import { HttpService } from '@renderer/services/http.service';
import { StringUtils } from '@renderer/utils/string.utils';
import { SshService } from '@renderer/services/ssh.service';
import { BasicService } from '@renderer/services/system/basic.service';
import { ForwardService } from '@renderer/services/forward.service';
import { FactoryService } from "@renderer/services/factory.service";
import { PrestoService } from "@renderer/services/presto.service";

@Injectable()
Expand All @@ -30,27 +30,7 @@ export class MonitorService extends ForwardService implements BaseService {
}

getSlowQuery(request: RequestModel, threshold: number): Promise<ResponseModel> {
const sql = StringUtils.format(`
SELECT
user,
client_hostname AS host,
client_name AS hash,
query AS query,
query_start_time AS time,
query_duration_ms AS elapsed,
round(memory_usage / 1048576) AS memoryUsage,
result_rows AS rows,
result_bytes / 1048576 AS bytes,
read_rows AS readRows,
round(read_bytes / 1048576) AS bytesRead,
written_rows AS writtenRows,
round(written_bytes / 1048576) AS bytesWritten
FROM system.query_log
WHERE type = 2
AND query_duration_ms >= {0}
ORDER BY query_duration_ms DESC
LIMIT 100
`, [threshold]);
const sql = StringUtils.format(this.factoryService.forward(request.config.type).slowQueryFetchAll, [threshold]);
return this.getResponse(request, sql);
}

Expand Down

0 comments on commit bade65d

Please sign in to comment.