This is an automated email from the ASF dual-hosted git repository.

qiuxiafan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git


The following commit(s) were added to refs/heads/main by this push:
     new e4a43d91 feat: enhance the async-profiling duration options (#472)
e4a43d91 is described below

commit e4a43d91e2e49a80a6eada333f0e84bf11a14013
Author: Forgottener <forgotte...@users.noreply.github.com>
AuthorDate: Mon Jun 2 17:18:58 2025 +0800

    feat: enhance the async-profiling duration options (#472)
---
 src/locales/lang/en.ts                             |  5 +++
 src/locales/lang/es.ts                             |  5 +++
 src/locales/lang/zh.ts                             |  5 +++
 .../related/async-profiling/components/NewTask.vue | 41 ++++++++++++++++++++--
 .../related/async-profiling/components/data.ts     |  9 +++--
 5 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts
index 12de6d03..ea77bc16 100644
--- a/src/locales/lang/en.ts
+++ b/src/locales/lang/en.ts
@@ -401,5 +401,10 @@ const msg = {
   recordsTTL: "Records TTL",
   clusterNodes: "Cluster Nodes",
   debuggingConfigDump: "Dump Effective Configurations",
+  customDuration: "Custom Duration",
+  maxDuration: "Max Duration",
+  minutes: "Minutes",
+  invalidProfilingDurationRange: "Please enter a valid duration between 1 and 
900 seconds",
+  taskCreatedSuccessfully: "Task created successfully",
 };
 export default msg;
diff --git a/src/locales/lang/es.ts b/src/locales/lang/es.ts
index 3a8dc0b2..ba7d7edc 100644
--- a/src/locales/lang/es.ts
+++ b/src/locales/lang/es.ts
@@ -401,5 +401,10 @@ const msg = {
   recordsTTL: "Records TTL",
   clusterNodes: "Cluster Nodes",
   debuggingConfigDump: "Dump Effective Configurations",
+  customDuration: "Duración Personalizada",
+  maxDuration: "Duración Máxima",
+  minutes: "Minutos",
+  invalidProfilingDurationRange: "Por favor ingrese una duración válida entre 
1 y 900 segundos",
+  taskCreatedSuccessfully: "Tarea creada exitosamente",
 };
 export default msg;
diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts
index 72b548cf..40c21e0e 100644
--- a/src/locales/lang/zh.ts
+++ b/src/locales/lang/zh.ts
@@ -399,5 +399,10 @@ const msg = {
   recordsTTL: "Records TTL",
   clusterNodes: "集群节点",
   debuggingConfigDump: "转储有效配置",
+  customDuration: "自定义时长",
+  maxDuration: "最大时长",
+  minutes: "分钟",
+  invalidProfilingDurationRange: "请输入1到900秒之间的有效时长",
+  taskCreatedSuccessfully: "任务创建成功",
 };
 export default msg;
diff --git a/src/views/dashboard/related/async-profiling/components/NewTask.vue 
b/src/views/dashboard/related/async-profiling/components/NewTask.vue
index 959d6ebf..e5c9c656 100644
--- a/src/views/dashboard/related/async-profiling/components/NewTask.vue
+++ b/src/views/dashboard/related/async-profiling/components/NewTask.vue
@@ -25,12 +25,25 @@ limitations under the License. -->
         :options="asyncProfilingStore.instances"
         placeholder="Select instances"
         @change="changeInstances"
-        :filterable="false"
+        :filterable="true"
       />
     </div>
     <div>
       <div class="label">{{ t("duration") }}</div>
       <Radio class="mb-5" :value="duration" :options="DurationOptions" 
@change="changeDuration" />
+      <div v-if="duration === DurationOptions[5].value" 
class="custom-duration">
+        <div class="label">{{ t("customDuration") }} ({{ t("seconds") }})</div>
+        <el-input
+          size="small"
+          class="profile-input"
+          v-model="customDurationSeconds"
+          type="number"
+          :min="1"
+          :max="900"
+          placeholder="Enter duration in seconds (1-900)"
+        />
+        <div class="hint">{{ t("maxDuration") }}: 900 {{ t("seconds") }} (15 
{{ t("minutes") }})</div>
+      </div>
     </div>
     <div>
       <div class="label">{{ t("profilingEvents") }}</div>
@@ -113,6 +126,7 @@ limitations under the License. -->
   const execArgs = ref<string>("");
   const loading = ref<boolean>(false);
   const PartofEvents = [ProfilingEvents[3], ProfilingEvents[4], 
ProfilingEvents[5]];
+  const customDurationSeconds = ref<number>(60);
 
   function changeDuration(val: string) {
     duration.value = val;
@@ -138,10 +152,22 @@ limitations under the License. -->
   }
 
   async function createTask() {
+    let finalDuration: number;
+
+    if (duration.value === DurationOptions[5].value) {
+      if (!customDurationSeconds.value || customDurationSeconds.value < 1 || 
customDurationSeconds.value > 900) {
+        ElMessage.error(t("invalidProfilingDurationRange"));
+        return;
+      }
+      finalDuration = customDurationSeconds.value;
+    } else {
+      finalDuration = Number(duration.value);
+    }
+
     const params = {
       serviceId: selectorStore.currentService.id,
       serviceInstanceIds: serviceInstanceIds.value,
-      duration: Number(duration.value) * 60,
+      duration: finalDuration,
       events: asyncEvents.value,
       execArgs: execArgs.value,
     };
@@ -158,7 +184,7 @@ limitations under the License. -->
       return;
     }
     emits("close");
-    ElMessage.success("Task created successfully");
+    ElMessage.success(t("taskCreatedSuccessfully"));
   }
 </script>
 <style lang="scss" scoped>
@@ -184,4 +210,13 @@ limitations under the License. -->
     width: 600px;
     margin-top: 50px;
   }
+
+  .custom-duration {
+    margin-top: 10px;
+  }
+
+  .hint {
+    font-size: $font-size-smaller;
+    color: var(--text-color-placeholder);
+  }
 </style>
diff --git a/src/views/dashboard/related/async-profiling/components/data.ts 
b/src/views/dashboard/related/async-profiling/components/data.ts
index f315a082..9ff5193b 100644
--- a/src/views/dashboard/related/async-profiling/components/data.ts
+++ b/src/views/dashboard/related/async-profiling/components/data.ts
@@ -16,9 +16,12 @@
  */
 
 export const DurationOptions = [
-  { value: "5", label: "5 min" },
-  { value: "10", label: "10 min" },
-  { value: "15", label: "15 min" },
+  { value: "30", label: "30 sec" },
+  { value: "60", label: "1 min" },
+  { value: "300", label: "5 min" },
+  { value: "600", label: "10 min" },
+  { value: "900", label: "15 min" },
+  { value: "custom", label: "Custom" },
 ];
 
 export const ProfilingEvents = ["CPU", "ALLOC", "LOCK", "WALL", "CTIMER", 
"ITIMER"];

Reply via email to