Commit 1caec78b by zhaihuitao

添加生产环境配置信息

parent d4610f67
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="d0064643-2990-4ed3-bfb0-875849b30f4e" name="Default" comment="" />
<list default="true" id="d0064643-2990-4ed3-bfb0-875849b30f4e" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/config/analysis.py" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/testcase/android_click/__init__.py" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/testcase/android_click/click.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -9,14 +15,39 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/trackingIO$click.coverage" NAME="click Coverage Results" MODIFIED="1596521706571" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase/android_click" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="prod.yaml" pinned="false" current-in-tab="true">
<file leaf-file-name="prod.yaml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/prod/prod.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="30">
<caret line="2" column="25" lean-forward="false" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="click.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/testcase/android_click/click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="58">
<caret line="32" column="27" lean-forward="true" selection-start-line="32" selection-start-column="27" selection-end-line="32" selection-end-column="27" />
<folding>
<element signature="e#110#123#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="analysis.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/config/analysis.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="25" lean-forward="false" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
<folding />
</state>
</provider>
......@@ -31,6 +62,18 @@
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/config/prod/prod.yaml" />
<option value="$PROJECT_DIR$/testcase/android_click/click.py" />
<option value="$PROJECT_DIR$/config/analysis.py" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
......@@ -42,6 +85,9 @@
<option name="width" value="1280" />
<option name="height" value="724" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
......@@ -137,7 +183,26 @@
</list>
</option>
</component>
<component name="RunManager">
<component name="RunManager" selected="Python.click">
<configuration default="false" name="click" type="PythonConfigurationType" factoryName="Python" temporary="true">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/testcase/android_click" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="trackingIO" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/testcase/android_click/click.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<method />
</configuration>
<configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -281,6 +346,14 @@
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Python.click" />
</list>
<recent_temporary>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Python.click" />
</list>
</recent_temporary>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
......@@ -293,17 +366,26 @@
<option name="presentableId" value="Default" />
<updated>1596505503233</updated>
</task>
<task id="LOCAL-00001" summary="添加生产环境配置信息">
<created>1596528175728</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1596528175728</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="724" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24959612" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24959612" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32838285" sideWeight="0.503231" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32838285" sideWeight="0.49676898" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
......@@ -325,15 +407,37 @@
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="添加生产环境配置信息" />
<option name="LAST_COMMIT_MESSAGE" value="添加生产环境配置信息" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/testcase/android_click/click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="58">
<caret line="32" column="27" lean-forward="true" selection-start-line="32" selection-start-column="27" selection-end-line="32" selection-end-column="27" />
<folding>
<element signature="e#110#123#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/prod/prod.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="30">
<caret line="2" column="25" lean-forward="false" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/analysis.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="25" lean-forward="false" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
<folding />
</state>
</provider>
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: analysis.py
@time: 2020/8/4 14:12
@desc: analysis yaml
"""
import yaml
with open('/Users/zhaihuitao/gitlab/trackingIO/config/prod/prod.yaml', 'r+', encoding='utf-8') as f:
config = yaml.load(f)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: __init__.py.py
@time: 2020/8/4 13:53
@desc:
"""
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: click.py
@time: 2020/8/4 13:56
@desc: android click
"""
import random
import requests
import socket
import struct
import config.analysis
import config.prod
import time
# 向短链发送点击数据
# !!!!分包需要删掉https的s
event = 'event_12'
cmpaignid = '3333'
# 广告创意ID
ry_adcreative_id = '999'
# 广告组ID
ry_adgroup_id = '999'
# 广告计划ID
ry_adplan_id = '999'
# 广告组名称
ry_adgroup_name = '广告组'
# 广告计划名称
ry_adplan_name = '广告计划'
# 广告创意名称
ry_adcreative_name = '广告创意'
s = 0
w = 0
#print(config['click']['url'])
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '167070728336'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '175.93.28.70'
try:
parms = {
# 'androidid': "43214532142142",
'imei': i,
# "idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
'ip': ip,
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko)
# Version/5.1 Mobile/9A334 Safari/7534.48.3", 'creativeId':'21321321312123', 'requestId':'312321321312',
# 'adId': long('21231'), 'ry_adgroup_name': ry_adgroup_name, 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
"ry_adgroup_id": ry_adgroup_id,
"ry_adplan_id": ry_adplan_id,
"ry_adcreative_id": ry_adcreative_id,
}
#timeout可以超时四秒
# verify = False
p = requests.get(url=config['click']['url'], params=parms, timeout=30, verify= False)
print('success:',s)
# print(p.text)
print('imei:',i)
#print('ip:',ip)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('imei:', i)
print('ip', ip)
w=w+1
continue
# time.sleep(7)
# try:
# allEvent().installUpload(i, ip, appkey, cmpaignid)
# except Exception as err:
# print('install_wrong:', w)
# w = w + 1
# print(err)
# time.sleep(1)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# # continue
# time.sleep(2)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# time.sleep(5)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception:
# print('付费_wrong:', w)
# time.sleep(2)
# try:
# allEvent().ziding_event(i, ip, appkey,event)
# except Exception:
# print('自定义_wrong:', w)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment