Skip to content

Commit

Permalink
refactor: modify activity weight (#1443)
Browse files Browse the repository at this point in the history
Signed-off-by: frank-zsy <[email protected]>
  • Loading branch information
frank-zsy authored Dec 11, 2023
1 parent a758326 commit 3c3a0ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cron/tasks/global_openrank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const task: Task = {
const backgroundRententionFactor = 0.15;
const openrankAttenuationFactor = 0.85;
const openrankMinValue = 0.1;
const acitivityToOpenrank = activity => Math.min(1, Math.log(activity + 1) / 5);
const acitivityToOpenrank = activity => Math.min(1, Math.log(activity + 1) / 3);

const createTable = async () => {
const sql = `CREATE TABLE IF NOT EXISTS ${globalOpenrankTableName}
Expand Down
10 changes: 5 additions & 5 deletions src/metrics/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import {
} from './basic';
import * as clickhouse from '../db/clickhouse';

export const ISSUE_COMMENT_WEIGHT = 1;
export const OPEN_ISSUE_WEIGHT = 2;
export const OPEN_PULL_WEIGHT = 3;
export const REVIEW_COMMENT_WEIGHT = 4;
export const PULL_MERGED_WEIGHT = 2;
export const ISSUE_COMMENT_WEIGHT = 0.5252;
export const OPEN_ISSUE_WEIGHT = 2.2235;
export const OPEN_PULL_WEIGHT = 4.0679;
export const REVIEW_COMMENT_WEIGHT = 0.7427;
export const PULL_MERGED_WEIGHT = 2.0339;

export const getRepoOpenrank = async (config: QueryConfig) => {
config = getMergedConfig(config);
Expand Down

0 comments on commit 3c3a0ba

Please sign in to comment.