summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongyuan Ma2018-08-14 13:38:11 +0000
committerHongyuan Ma2018-08-14 13:38:11 +0000
commit56e56593262dd31e6f2d6ff86c801f6533d2d9fc (patch)
treee785f517362732bd58120076b957462297fadbcb
parent8671057a1585718063bbe66dc0ac94d4637f5bcd (diff)
Online adaptation
-rw-r--r--client/post-example/results.json24
-rw-r--r--client/post-example/upload.py6
-rw-r--r--front-end/src/page/farmerApply/index.jsx4
-rw-r--r--front-end/src/util/util.jsx2
-rw-r--r--front-end/webpack.config.js2
-rw-r--r--web/db_tools/data/user_data.py16
-rw-r--r--web/db_tools/import_user_data.py2
7 files changed, 34 insertions, 22 deletions
diff --git a/client/post-example/results.json b/client/post-example/results.json
index ba57808..ba47aaa 100644
--- a/client/post-example/results.json
+++ b/client/post-example/results.json
@@ -4,8 +4,8 @@
"10": {
"1": {
"std": 0.0,
- "metric": 30551.681364,
- "median": 30551.681364,
+ "metric": 10551.681364,
+ "median": 10551.681364,
"results": [
{
"latency": -1,
@@ -24,8 +24,8 @@
},
"2": {
"std": 0.0,
- "metric": 38238.312979,
- "median": 38238.312979,
+ "metric": 28238.312979,
+ "median": 28238.312979,
"results": [
{
"latency": -1,
@@ -44,8 +44,8 @@
},
"4": {
"std": 0.0,
- "metric": 35567.822014,
- "median": 35567.822014,
+ "metric": 25567.822014,
+ "median": 25567.822014,
"results": [
{
"latency": -1,
@@ -68,8 +68,8 @@
"10": {
"1": {
"std": 0.0,
- "metric": 116.508045,
- "median": 116.508045,
+ "metric": 216.508045,
+ "median": 216.508045,
"results": [
{
"latency": -1,
@@ -131,13 +131,13 @@
},
"postgres": {
"commit": "c6736ff76046521f56c50deb31da218bc1b29533",
- "branch": "rel_9_5_stable",
+ "branch": "master",
"settings": {
- "checkpoint_timeout": "20min",
+ "checkpoint_timeout": "15min",
"log_temp_files": "32",
"work_mem": "64MB",
"log_line_prefix": "%n %t ",
- "shared_buffers": "2GB",
+ "shared_buffers": "1GB",
"log_autovacuum_min_duration": "0",
"checkpoint_completion_target": "0.9",
"maintenance_work_mem": "128MB",
@@ -154,7 +154,7 @@
"collectd": {},
"meta": {
"date": "2018-07-17 23:02:57.000000+00",
- "uname": "Linux postgresql-gsoc1 4.9.0-6-powerpc64le #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) ppc64le GNU/Linux\n",
+ "uname": "Linux postgresql-gsoc 4.9.0-6-powerpc64le #1 SMP Centos 4.9.88-1+deb9u1 (2018-05-07) ppc64le GNU/Linux\n",
"benchmark": "pgbench",
"name": "pgbench-basic"
},
diff --git a/client/post-example/upload.py b/client/post-example/upload.py
index 467497c..b0164d4 100644
--- a/client/post-example/upload.py
+++ b/client/post-example/upload.py
@@ -14,9 +14,9 @@ def byteify(input):
return input
-token = '0ae27ecb064ff5283296b297bac77d9e'
-# BASE_URL = 'http://140.211.168.111:8080/'
-BASE_URL = 'http://127.0.0.1:8000/'
+token = '0232f37f8e1726684516434441af745'
+BASE_URL = 'http://140.211.168.111:8080/'
+# BASE_URL = 'http://127.0.0.1:8000/'
PATH_URL = 'upload/'
url = BASE_URL + PATH_URL
diff --git a/front-end/src/page/farmerApply/index.jsx b/front-end/src/page/farmerApply/index.jsx
index 43068e3..46a9a80 100644
--- a/front-end/src/page/farmerApply/index.jsx
+++ b/front-end/src/page/farmerApply/index.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import {hashHistory} from 'React-router'
+import {hashHistory} from 'react-router'
import './index.css';
import {Link} from 'react-router-dom';
import UserInfoCard from 'component/userinfo-card/index.jsx'
@@ -97,7 +97,7 @@ class FarmerApply extends React.Component {
_user.farmerApply(machineInfo).then((res) => {
// console.dir(res)
alert('add machine success!')
- hashHistory.push('/portal')
+ //hashHistory.push('/portal')
// window.location.href = this.state.redirect;
}, (err) => {
// console.log(err)
diff --git a/front-end/src/util/util.jsx b/front-end/src/util/util.jsx
index 6a93479..fa4c504 100644
--- a/front-end/src/util/util.jsx
+++ b/front-end/src/util/util.jsx
@@ -11,7 +11,7 @@ class PGUtil {
$.ajax({
type: param.type || 'get',
url: param.url || '',
- dataType: param.dataType || 'json',
+ dataType: param.dataType || 'jsonp',
data: param.data || null,
// headers: {
// 'Authorization': 'Token ' + user.token
diff --git a/front-end/webpack.config.js b/front-end/webpack.config.js
index 4eeec6b..3cbe060 100644
--- a/front-end/webpack.config.js
+++ b/front-end/webpack.config.js
@@ -9,7 +9,7 @@ module.exports = {
entry: './src/app.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
- publicPath: WEBPACK_ENV === 'dev' ? '' : '//140.211.168.111/front-end-code/dist/',
+ publicPath: WEBPACK_ENV === 'dev' ? '/dist/' : '//140.211.168.111/front-end-code/dist/',
filename: 'js/app.js'
},
resolve: {
diff --git a/web/db_tools/data/user_data.py b/web/db_tools/data/user_data.py
index aa4f3f6..0ad938f 100644
--- a/web/db_tools/data/user_data.py
+++ b/web/db_tools/data/user_data.py
@@ -1,14 +1,26 @@
row_data = [
{
'password': '123456',
- 'is_superuser': False,
+ 'is_superuser': True,
'username': 'maleic',
'first_name': 'Maleic',
'last_name': 'Acid',
- 'date_joined': '2018-06-14 21:34:51+08',
+ 'date_joined': '2018-08-10 21:34:51+08',
'email': '[email protected]',
'is_staff': False,
'is_active': True,
'last_login': '2018-06-14 21:34:51+08',
},
+ {
+ 'password': '123456',
+ 'is_superuser': True,
+ 'username': 'mark',
+ 'first_name': 'Mark',
+ 'last_name': 'Wong',
+ 'date_joined': '2018-08-10 21:34:51+08',
+ 'email': '[email protected]',
+ 'is_staff': False,
+ 'is_active': True,
+ 'last_login': '2018-06-14 21:34:51+08',
+ },
] \ No newline at end of file
diff --git a/web/db_tools/import_user_data.py b/web/db_tools/import_user_data.py
index 799e5f9..987c095 100644
--- a/web/db_tools/import_user_data.py
+++ b/web/db_tools/import_user_data.py
@@ -1,6 +1,6 @@
import sys
import os
-from pgperffarm.settings import PORJECT_PATH
+from path import PORJECT_PATH
# Use django's model independently
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.append(pwd+ "../")