Skip to content

Commit

Permalink
fix: channel event revert to ali-rds namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Jan 30, 2024
1 parent 520f99d commit edb6204
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { RDSClient } from './client';

export default {
// pool events https://github.com/mysqljs/mysql#pool-events
connectionNew: diagnosticsChannel.channel('myrds:connection:new'),
connectionAcquire: diagnosticsChannel.channel('myrds:connection:acquire'),
connectionRelease: diagnosticsChannel.channel('myrds:connection:release'),
connectionEnqueue: diagnosticsChannel.channel('myrds:connection:enqueue'),
connectionNew: diagnosticsChannel.channel('ali-rds:connection:new'),
connectionAcquire: diagnosticsChannel.channel('ali-rds:connection:acquire'),
connectionRelease: diagnosticsChannel.channel('ali-rds:connection:release'),
connectionEnqueue: diagnosticsChannel.channel('ali-rds:connection:enqueue'),
// query
queryStart: diagnosticsChannel.channel('myrds:query:start'),
queryEnd: diagnosticsChannel.channel('myrds:query:end'),
queryStart: diagnosticsChannel.channel('ali-rds:query:start'),
queryEnd: diagnosticsChannel.channel('ali-rds:query:end'),
};

export interface ConnectionMessage {
Expand Down
2 changes: 1 addition & 1 deletion src/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import channels from './channels';
import type { QueryStartMessage, QueryEndMessage } from './channels';

const debug = debuglog('myrds:operator');
const debug = debuglog('ali-rds:operator');

/**
* Operator Interface
Expand Down
4 changes: 2 additions & 2 deletions test/PoolConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ describe('test/PoolConfig.test.ts', () => {
let end = false;

before(async () => {
diagnosticsChannel.subscribe('myrds:connection:new', message => {
diagnosticsChannel.subscribe('ali-rds:connection:new', message => {
if (end) return;
const { connection } = message as ConnectionMessage;
console.log('[diagnosticsChannel] connection threadId %o created', connection.threadId);
newConnectionCountByDiagnosticsChannel++;
});
diagnosticsChannel.subscribe('myrds:query:end', message => {
diagnosticsChannel.subscribe('ali-rds:query:end', message => {
if (end) return;
const { connection, sql, duration, error } = message as QueryEndMessage;
console.log('[diagnosticsChannel] connection threadId %o query %o, duration: %oms, error: %o',
Expand Down

0 comments on commit edb6204

Please sign in to comment.