file-type

ACP开源版本发布:分布式性能测试平台的实现与特性

ZIP文件

下载需积分: 10 | 45.26MB | 更新于2025-09-03 | 70 浏览量 | 2 下载量 举报 收藏
download 立即下载
标题中提到的“alimama-common-performance-platform-acp”指的是一个通用性能测试平台和工具,通常简称为ACP。该平台是基于Zookeeper构建的分布式性能测试工具,专门用于各种业务线的性能测试工作。Zookeeper是一个开源的分布式协调服务,它提供配置管理、命名服务、分布式锁等同步功能。使用Zookeeper作为平台的核心,意味着ACP能够高效地管理分布在不同机器上的测试代理(Agent),并协调它们执行任务。 描述部分详细介绍了ACP平台的特性。首先,它是用Python实现的,Python作为一种广泛使用的高级编程语言,在数据处理、科学计算以及网络编程等多个领域都有出色的表现。ACP通过Python编写,使得开发者可以更容易地进行代码的编写、维护和扩展。 此外,该平台是一个大型分布式系统,可以同时调度数以万计的代理执行性能测试任务。在分布式系统中,代理或节点可以分布在网络中的不同位置,协同工作以完成特定任务。在性能测试中,这意味着可以在不同的物理机器或虚拟环境中模拟出大量的用户行为,从而对服务进行压力测试,检验系统在高负载情况下的表现。 描述中还提到,ACP能够将任务分配到协议和压测数据类型的级别。这意味着ACP可以对不同类型的网络协议(如HTTP、TCP/IP等)以及不同类别的测试数据进行有针对性的性能测试。这样的细粒度管理对于确保测试结果的准确性和全面性非常关键。 “通用任务执行agent”是指ACP中能够执行多种测试任务的代理程序。这些代理程序可以按照调度指令独立或协同地执行测试脚本或测试用例。通用性使得ACP具有较高的灵活性和适应性,能够适应不同的测试场景和需求。 描述还提到ACP提供了运维页面和部署脚本,这表明ACP不仅是一个用于执行性能测试的平台,它还考虑到了运维的便捷性。运维页面通常用于实时监控测试过程、查看测试报告、管理测试任务和代理等。部署脚本则简化了ACP平台的安装和部署过程,能够帮助运维人员快速搭建和配置测试环境。 标签“Python”强调了ACP平台开发的主要编程语言。Python语言简单易学、可读性强,又有着丰富的库支持,非常适合用于开发各种类型的应用程序,特别是在数据科学、网络应用、自动化脚本等领域。 最后,压缩包子文件的文件名称列表中的“alimama-common-performance-platform-acp-master”指的是ACP平台的源代码压缩包文件名。通常在Git等版本控制系统中,一个项目的主分支(master或main)会被视为项目的稳定版或最新版。通过这个文件名,可以推测ACP的源代码可以在相关代码托管平台(如GitHub)上找到,并且该文件名暗示了这可能是ACP的主分支代码。 综上所述,ACP是一个功能强大的分布式性能测试平台,它利用Zookeeper的分布式协调能力,通过Python编程实现,提供智能调度和任务执行等功能,适用于对各种业务进行压力测试和性能优化。

相关推荐

filetype

<script setup lang="ts"> import { userService } from '@/api/service/user' import avatar from '@/assets/images/avatar.webp' import { useAppStore, useMenuStore } from '@/store' import { User } from '@element-plus/icons-vue' import { useRouter } from 'vue-router' import apps from '~icons/custom/apps' import exit from '~icons/custom/exit' import unlock from '~icons/custom/unlock' import ChangePasswordDialog from './change-password/index.vue' import UserInfo from './user-info/index.vue' import VOYAHlogo from '/Vhome.svg' defineOptions({ name: 'LayoutHeader', }) // 修改密码的窗口是否可见 const changePasswordDialogVisible = ref(false) // 个人信息的窗口是否可见 const checkUserInfoVisible = ref(false) const appStore = useAppStore() const { isEnglish: _isEnglish, } = storeToRefs(appStore) const router = useRouter() const userInfoRef = ref() function redirectGlobal() { router.push({ name: 'Dashboard' }) } async function handleCommand(command: string | number | object) { switch (command) { case 'logout': { try { await ElMessageBox.confirm( '确认要注销吗?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', }, ) await userService.logout() localStorage.setItem('token', '') window.$message.success('注销成功') router.push({ name: 'Login' }) } catch (error) { console.error(error) window.$message?.error('注销失败,请重试') } break } case 'modifyPwd': { changePasswordDialogVisible.value = true break } case 'userInfo': { checkUserInfoVisible.value = true userInfoRef.value.open() break } default: break } } const userInfo = ref<any>({ avatar: '', username: '', roleName: '', mobile: '', roleNameList: [], source: '', email: '', }) const menuStore = useMenuStore() const { filterMenu } = menuStore onActivated(async () => { getUserInfoFn() }) onMounted(() => { getUserInfoFn() }) async function getUserInfoFn() { const { data } = await userService.getUserInfo() userInfo.value = data filterMenu(userInfo.value.roleIdList) } </script> <template>
<el-image class="wh-8" :src="VOYAHlogo" fit="scale-down" @click="redirectGlobal" /> {{ $t('system.title') }} <el-divider direction="vertical" style="height: 22px; margin:0;" /> <el-button text circle> <el-icon size="20"> <apps /> </el-icon> </el-button>
<el-popover popper-class="user-center w-50" popper-style="width: 200px; padding: 0;" placement="bottom" :show-arrow="false" > <template #reference> <el-avatar :src="userInfo.avatar" :size="40" class="cursor-pointer" /> </template> <template #default>
<el-avatar :src="userInfo.avatar" :size="40" class="cursor-pointer" /> {{ userInfo.username }} {{ userInfo.roleName }}
<el-button class="operation-btn" link @click="handleCommand('userInfo')"> <el-icon :size="20" class="mr-2"> <User /> </el-icon>个人信息 </el-button> <el-button class="operation-btn" link @click="handleCommand('modifyPwd')"> <el-icon :size="20" class="mr-2"> <unlock /> </el-icon>修改密码 </el-button> <el-divider class="operation-divider" /> <el-button class="operation-btn" type="danger" link @click="handleCommand('logout')"> <el-icon :size="20" class="mr-2"> <exit /> </el-icon>退出系统 </el-button>
</template> </el-popover>
<ChangePasswordDialog v-model="changePasswordDialogVisible" /> <UserInfo ref="userInfoRef" v-model="checkUserInfoVisible" v-model:user-info="userInfo" @confirm-ok="getUserInfoFn" />
</template> <style lang="scss" scoped> .header-title { font-family: Alimama ShuHeiTi; } .header-right-content-wrapper { .el-button + .el-button { margin-left: 0; } } </style> <style> .el-popper.el-popover.user-center { --el-popover-border-radius: 8px; background: url('@/assets/images/header/user-center-bg.webp'); background-position: center; background-size: auto 140%; background-repeat: no-repeat; border: none; box-shadow: 0px 8px 20px 0px rgba(31, 39, 51, 0.09); .operation { .operation-btn { height: 32px; margin-left: 0; } .operation-divider { margin: 12px 0; } } } </style> 为什么我修改完之后userInfo.avatar没有响应式更新啊?

filetype

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>拍拍印</title> <style> body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; } /* 新增滑动轮播关键样式 */ .container { overflow: hidden; position: relative; width: 100vw; height: 100vh; } .slide-track { display: flex; width: 100%; height: 100vh; transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1); /* 平滑过渡效果 */ } .slide { flex: 1 0 100vw; /* 每张占满视口宽度 */ background-size: cover; background-position: center; } /* 无限循环关键技巧) */ .slide-track::before, .slide-track::after { content: ''; flex: 100vw; /* 复制首尾图片实现无缝 */ background-image: inherit; } .content { position: absolute; top: 35.5%; left: 4.2%; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 0 auto; } .box { display: grid; grid-template-columns: repeat(2, 1fr); /* 两列 */ gap: 36px; margin-left: 22px; margin-top: -20px; } .box.no-margin { margin-top: 0 !important; } .item { background-color: #B13627; border-radius: 50px; width: 455px; height: 512px; } .item2 { background-color: #B13627; border-radius: 40px; width: 455px; margin-top: 20px; } .topDiv { width: 100%; height: 172px; } .divP { width: 70%; height: 86px; background-color: #00000000; color: #ffffff; font-size: 64px; font-weight: 700; letter-spacing: 2px; margin-left: 25px; } .divP2 { width: 240px; height: 48px; background-color: #ffffff; color: #000; font-size: 24px; letter-spacing: 2px; margin-left: 30px; display: flex; align-items: center; justify-content: center; margin-top: -50px; border-radius: 25px } .bottomDiv { position: relative; /* 使子元素的绝对定位相对于此元素 */ height: 307px; /* 确保容器有确定的高度 */ } .butDiv, .butDiv2 { position: absolute; left: 20px; bottom: 20px; /* 放置在底部 */ width: calc(100% - 40px); /* 宽度减去左右边距 */ z-index: 10; /* 确保它在图片上方 */ margin-top: 0; /* 移除之前的margin-top */ } /* 调整报纸头条部分 */ .item .butDiv { margin-top: 0; top: auto; /* 重置顶部位置 */ bottom: 20px; /* 放置在底部 */ margin-left: 0; /* 移除左外边距 */ } /* 修改斑马日报和自助打印的按钮位置 */ .item2 .butDiv2 { position: absolute; width: calc(100% - 40px); bottom: 20px; top: -80px; margin-top: 0; margin-left: 0; } /* 调整按钮在卡片内的位置 */ .button, .button2 { margin-top: -13px; margin-left: 265px; position: static; /* 按钮使用默认定位 */ } /* 调整顶部区域避免重叠 */ .topDiv { margin-top: -30px; /* 适当上移 */ z-index: 5; /* 确保在butDiv之上 */ } /* 调整斑马日报和自助打印高度 */ .item2 { position: relative; /* 确保绝对定位元素有参考点 */ height: 236px; } .bottomDiv img { width: 100%; height: 100%; } .butDiv { width: 415px; height: 93px; background-color: #ffffff; border-radius: 47px; margin-top: 185px; margin-left: 20px; } .butDiv2 { width: 415px; height: 93px; background-color: #ffffff; border-radius: 47px; margin-top: 0px; margin-left: 20px; } .avaiDiv { width: 220px; height: 73px; margin-top: 16px; margin-left: 8px; } .available { font-size: 38px; margin-left: 30px; align-self: center; color: #303030; font-weight: 700; } .sizelabie { font-size: 20px; color: #606060; } .button { width: 140px; height: 73px; background-color: #000; border-radius: 50px; margin-top: -60px; margin-left: 255px; display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 25px; } .button2 { width: 140px; height: 73px; background-color: #000; border-radius: 50px; margin-top: -65px; margin-left: 255px; display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 25px; } /* 弹窗样式 */ #popup { display: none; } #popup-mask { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.6); z-index: 999; } #popup-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; background: white; border-radius: 10px; padding: 40px; text-align: center; width: 70%; } #popup-content img { width: 60%; height: 60%; padding: 40px 0; } .popup-header { display: flex; justify-content: space-between; align-items: center; } #popup-close { font-size: 40px; font-weight: bold; color: #000; cursor: pointer; user-select: none; } #countdown { font-size: 26px; color: #000; text-align: right; } .title { text-align: center; font-size: 40px; color: #000; } /* 新增小项目容器样式 */ .small-items-container { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 20px; } /* 修改小项目宽度为100% */ .item2 { background-color: #B13627; border-radius: 40px; width: 100%; /* 从固定宽度改为100% */ height: 236px; /* 移除原来的margin-bottom */ } </style> </head> <body>
×
倒计时:120 秒

微信扫码解锁自助打印

二维码

<script> let newspaperData = [] // 获取当前页面的URL参数值 function getQueryParam(paramName) { //(去掉开头的'?') const queryString = window.location.search.substring(1); const params = queryString.split('&'); for (const param of params) { const pair = param.split('='); // 对参数名和值进行URL解码 const name = decodeURIComponent(pair[0]); const value = pair.length > 1 ? decodeURIComponent(pair[1]) : ''; if (name === paramName) { return value; } } // 找不到目标参数返回 return 'C0GSLS'; } // 创建API请求函数 async function fetchNewsData() { const codeValue = getQueryParam('terminalCode'); return fetch(`http://192.168.8.117:5175/api/v1/Common/GetModules?terminalCode=${codeValue}`, { method: "get", headers: { "Content-Type": "application/json" }, }) .then(response => response.json()) .then(res => { if (res.code === 200) { // .slice(0, 4) 截取 return res.data.slice(0, 4).map(module => ({ id: module.id, title: module.moduleName, subtitle: module.moduleDesc, available: module.photoOriginalPrice, size: module.printType == 2 ? "A3报纸" : '6寸照片', image: module.coverImage || "./assets/group.png", moduleUrl: `${module.moduleUrl}?terminalCode=${codeValue}&moduleCode=${module.moduleCode}` })); } else { console.log("请求返回错误:", res.message); return []; } }) .catch(error => { console.error('API请求错误:', error); return []; }); } // 优化初始化函数 async function init() { try { // 等待API返回数据 newspaperData = await fetchNewsData(); console.log("获取到的数据:", newspaperData); // 确保在数据获取后再渲染 renderItems(newspaperData); setupEventListeners(); setupJumpLinks(); // 启动轮播图(新增) setupSlider(); } catch (error) { console.error('初始化失败:', error); // 使用空数组渲染结构 renderItems([]); } } document.addEventListener('touchstart', function (event) { if (event.touches.length > 1) { event.preventDefault(); } }, { passive: false }); let countdownTimer = null; function showPopup() { document.getElementById('popup').style.display = 'block'; let timeLeft = 120; const countdownEl = document.getElementById('countdown'); countdownEl.textContent = `倒计时:${timeLeft} 秒`; countdownTimer = setInterval(() => { timeLeft--; countdownEl.textContent = `倒计时:${timeLeft} 秒`; if (timeLeft <= 0) { hidePopup(); } }, 1000); } // 修改后的渲染函数--判断长度渲染逻辑 function renderItems(data) { const container = document.getElementById('newsContainer'); container.innerHTML = ''; // 获取box元素 const boxElement = container.closest('.box'); if (data.length === 0) { // 没有数据时显示提示 container.innerHTML = `
数据加载中,请稍后...
`; return; } // 原有布局渲染逻辑保持不变 if (data.length === 4) { // 当数组长度为4时,添加no-margin类 boxElement.classList.add('no-margin'); // 长度为4时的布局:全部为大盒子(.item) data.forEach(item => { container.appendChild(createItem(item)); }); } else if (data.length === 5) { // 其他情况下移除no-margin类 boxElement.classList.remove('no-margin'); // 长度为5时的布局:前3个大盒子,最后2个小盒子放在第三个大盒子位置上下排列 // 第一列(包含前2个大盒子) const leftCol = document.createElement('div'); leftCol.className = 'layout-column'; leftCol.appendChild(createItem(data[0])); leftCol.appendChild(createItem(data[1])); container.appendChild(leftCol); // 第二列(包含第三个大盒子和小盒子容器) const rightCol = document.createElement('div'); rightCol.className = 'layout-column'; // 添加第三个大项目 rightCol.appendChild(createItem(data[2])); // 创建小项目容器(包含第四和第五个项目) const smallContainer = document.createElement('div'); smallContainer.className = 'small-items-container'; smallContainer.appendChild(createItem2(data[3])); smallContainer.appendChild(createItem2(data[4])); // 添加小项目容器到第二列 rightCol.appendChild(smallContainer); // 将第二列添加到容器 container.appendChild(rightCol); } else { // 通用渲染方案 - 使用网格布局 const gridContainer = document.createElement('div'); gridContainer.className = 'box'; gridContainer.style.display = 'grid'; gridContainer.style.gridTemplateColumns = 'repeat(2, 1fr)'; gridContainer.style.gap = '36px'; data.forEach(item => { // 根据位置决定渲染大项目或小项目 if (gridContainer.childElementCount < 2) { gridContainer.appendChild(createItem(item)); } else { gridContainer.appendChild(createItem2(item)); } }); container.appendChild(gridContainer); } } function hidePopup() { document.getElementById('popup').style.display = 'none'; if (countdownTimer) clearInterval(countdownTimer); } // 为静态数据添加跳转功能 function setupJumpLinks() { // 为所有按钮添加点击事件 document.querySelectorAll('.print-button').forEach(button => { button.addEventListener('click', function (e) { e.stopPropagation(); // 获取所在项目的data-moduleUrl属性 const container = this.closest('[data-module-url]'); if (container) { const url = container.dataset.moduleUrl; if (url && url !== 'undefined') { window.location.href = url; } else { console.error('无效的跳转URL'); } } }); }); } // 创建大项目(报纸头条) function createItem(item) { const itemElement = document.createElement('div'); itemElement.className = 'item'; itemElement.dataset.id = item.id; itemElement.dataset.moduleUrl = item.moduleUrl; // 添加跳转URL itemElement.innerHTML = `

${item.title}

${item.subtitle}

${item.title}
${item.available} / ${item.size}
点击体验
`; return itemElement; } // 创建小项目(自助打印) function createItem2(item) { const itemElement = document.createElement('div'); itemElement.className = 'item2'; itemElement.dataset.id = item.id; itemElement.dataset.moduleUrl = item.moduleUrl; // 添加跳转URL itemElement.innerHTML = `

${item.title}

${item.available} / ${item.size}
点击体验
`; return itemElement; } // 事件监听处理 function setupEventListeners() { document.getElementById('newsContainer').addEventListener('click', function (e) { if (e.target.classList.contains('print-button')) { const itemContainer = e.target.closest('[data-id]'); if (itemContainer) { const itemId = itemContainer.dataset.id; showPopup(); } } }); document.getElementById('popup-mask').onclick = hidePopup; document.getElementById('popup-close').onclick = hidePopup; } // 新增轮播图设置函数 function setupSlider() { const track = document.querySelector('.slide-track'); const slides = document.querySelectorAll('.slide'); let currentIndex = 0; const intervalTime = 5000; // 确保至少有2张幻灯片 if (slides.length < 2) return; function nextSlide() { currentIndex = (currentIndex + 1) % slides.length; track.style.transform = `translateX(-${currentIndex * 100}%)`; if (currentIndex === slides.length - 1) { setTimeout(() => { track.style.transition = 'none'; currentIndex = 0; track.style.transform = 'translateX(0)'; setTimeout(() => { track.style.transition = 'transform 1.5s cubic-bezier(0.4, 0, 0.2, 1)'; }, 50); }, 1500); } } let slideInterval = setInterval(nextSlide, intervalTime); track.addEventListener('mouseenter', () => clearInterval(slideInterval)); track.addEventListener('mouseleave', () => { slideInterval = setInterval(nextSlide, intervalTime); }); } // 移除DOMContentLoaded中的测试按钮代码 document.addEventListener('DOMContentLoaded', init); </script> </body> </html> 把class="divP"的字体改为Alimama ShuHeiTi,其他包涵字体的class的样式字体改为 Alibaba PuHuiTi
亲爱的薄荷绿
  • 粉丝: 42
上传资源 快速赚钱