Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
bb6c627b
S
Serving
项目概览
PaddlePaddle
/
Serving
1 年多 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bb6c627b
编写于
8月 04, 2020
作者:
B
barriery
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update log
上级
47d71a5c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
107 addition
and
13 deletion
+107
-13
python/examples/pipeline/imdb_model_ensemble/config.yml
python/examples/pipeline/imdb_model_ensemble/config.yml
+2
-0
python/examples/pipeline/imdb_model_ensemble/test_pipeline_server.py
...ples/pipeline/imdb_model_ensemble/test_pipeline_server.py
+8
-6
python/pipeline/analyse.py
python/pipeline/analyse.py
+1
-1
python/pipeline/channel.py
python/pipeline/channel.py
+1
-1
python/pipeline/dag.py
python/pipeline/dag.py
+1
-1
python/pipeline/logger.py
python/pipeline/logger.py
+90
-0
python/pipeline/operator.py
python/pipeline/operator.py
+1
-1
python/pipeline/pipeline_client.py
python/pipeline/pipeline_client.py
+1
-1
python/pipeline/pipeline_server.py
python/pipeline/pipeline_server.py
+1
-1
python/pipeline/profiler.py
python/pipeline/profiler.py
+1
-1
未找到文件。
python/examples/pipeline/imdb_model_ensemble/config.yml
浏览文件 @
bb6c627b
...
...
@@ -6,3 +6,5 @@ dag:
client_type
:
brpc
retry
:
1
use_profile
:
false
tracer
:
interval_s
:
10
python/examples/pipeline/imdb_model_ensemble/test_pipeline_server.py
浏览文件 @
bb6c627b
...
...
@@ -12,20 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=doc-string-missing
import
logging
logging
.
basicConfig
(
format
=
"[%(process)d](%(threadName)s) %(levelname)s %(asctime)s [%(filename)s:%(lineno)d] %(message)s"
,
level
=
logging
.
INFO
)
import
paddle_serving_server.pipeline
as
pipeline
from
paddle_serving_server.pipeline
import
Op
,
RequestOp
,
ResponseOp
from
paddle_serving_server.pipeline
import
PipelineServer
from
paddle_serving_server.pipeline.proto
import
pipeline_service_pb2
from
paddle_serving_server.pipeline.channel
import
ChannelDataEcode
import
numpy
as
np
from
paddle_serving_app.reader
import
IMDBDataset
import
logging
_LOGGER
=
logging
.
getLogger
()
console_handler
=
pipeline
.
logger
.
StreamHandler
()
console_handler
.
setLevel
(
logging
.
INFO
)
console_handler
.
setFormatter
(
logging
.
Formatter
(
"%(levelname)s %(asctime)s [%(filename)s:%(lineno)d] %(message)s"
))
_LOGGER
.
addHandler
(
console_handler
)
class
ImdbRequestOp
(
RequestOp
):
...
...
python/pipeline/analyse.py
浏览文件 @
bb6c627b
...
...
@@ -17,7 +17,7 @@ import copy
import
re
import
logging
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.analyse"
)
class
Analyst
(
object
):
...
...
python/pipeline/channel.py
浏览文件 @
bb6c627b
...
...
@@ -29,7 +29,7 @@ import enum
import
os
import
copy
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.channel"
)
class
ChannelDataEcode
(
enum
.
Enum
):
...
...
python/pipeline/dag.py
浏览文件 @
bb6c627b
...
...
@@ -32,7 +32,7 @@ from .profiler import TimeProfiler, PerformanceTracer
from
.util
import
NameGenerator
from
.proto
import
pipeline_service_pb2
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.dag"
)
class
DAGExecutor
(
object
):
...
...
python/pipeline/logger.py
0 → 100644
浏览文件 @
bb6c627b
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
logging
import
logging.handlers
import
os
class
SectionLevelFilter
(
object
):
def
__init__
(
self
,
levels
):
self
.
_levels
=
levels
def
filter
(
self
,
logRecord
):
return
logRecord
.
levelno
in
self
.
_levels
class
OutOfMouduleFilter
(
object
):
def
__init__
(
self
,
out_names
):
self
.
_out_names
=
out_names
def
filter
(
self
,
logRecord
):
return
logRecord
.
name
not
in
self
.
_out_names
class
OutOfMouduleAndSectionLevelFilter
(
object
):
def
__init__
(
self
,
out_names
,
levels
):
self
.
_out_names
=
out_names
self
.
_levels
=
levels
def
filter
(
self
,
logRecord
):
if
logRecord
.
name
in
self
.
_out_names
:
return
False
return
logRecord
.
levelno
in
self
.
_levels
class
StreamHandler
(
logging
.
StreamHandler
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
StreamHandler
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
addFilter
(
OutOfMouduleFilter
([
"pipeline.profiler"
]))
log_dir
=
"PipelineServingLogs"
if
not
os
.
path
.
exists
(
log_dir
):
os
.
makedirs
(
log_dir
)
# root logger
_LOGGER
=
logging
.
getLogger
()
_LOGGER
.
setLevel
(
logging
.
DEBUG
)
formatter
=
logging
.
Formatter
(
"%(levelname)s %(asctime)s [%(filename)s:%(lineno)d] %(message)s"
)
# info and warn
file_info
=
logging
.
handlers
.
RotatingFileHandler
(
os
.
path
.
join
(
log_dir
,
"INFO.log"
))
file_info
.
addFilter
(
OutOfMouduleFilter
([
"pipeline.profiler"
]))
file_info
.
addFilter
(
SectionLevelFilter
([
logging
.
INFO
,
logging
.
WARNING
]))
file_info
.
setFormatter
(
formatter
)
# err and critical
file_err
=
logging
.
handlers
.
RotatingFileHandler
(
os
.
path
.
join
(
log_dir
,
"ERROR.log"
))
file_err
.
addFilter
(
OutOfMouduleFilter
([
"pipeline.profiler"
]))
file_err
.
setLevel
(
logging
.
ERROR
)
file_err
.
setFormatter
(
formatter
)
_LOGGER
.
addHandler
(
file_info
)
_LOGGER
.
addHandler
(
file_err
)
# tracer logger
_TRACER
=
logging
.
getLogger
(
"pipeline.profiler"
)
_TRACER
.
setLevel
(
logging
.
INFO
)
_TRACER
.
addFilter
(
logging
.
Filter
(
"pipeline.profiler"
))
# tracer
tracer_formatter
=
logging
.
Formatter
(
"%(asctime)s %(message)s"
)
file_trace
=
logging
.
handlers
.
RotatingFileHandler
(
os
.
path
.
join
(
log_dir
,
"TRACE.log"
))
file_trace
.
setFormatter
(
tracer_formatter
)
_TRACER
.
addHandler
(
file_trace
)
python/pipeline/operator.py
浏览文件 @
bb6c627b
...
...
@@ -32,7 +32,7 @@ from .channel import (ThreadChannel, ProcessChannel, ChannelDataEcode,
from
.util
import
NameGenerator
from
.profiler
import
UnsafeTimeProfiler
as
TimeProfiler
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.operator"
)
_op_name_gen
=
NameGenerator
(
"Op"
)
...
...
python/pipeline/pipeline_client.py
浏览文件 @
bb6c627b
...
...
@@ -22,7 +22,7 @@ from .channel import ChannelDataEcode
from
.proto
import
pipeline_service_pb2
from
.proto
import
pipeline_service_pb2_grpc
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.pipeline_client"
)
class
PipelineClient
(
object
):
...
...
python/pipeline/pipeline_server.py
浏览文件 @
bb6c627b
...
...
@@ -26,7 +26,7 @@ from .proto import pipeline_service_pb2_grpc
from
.operator
import
ResponseOp
from
.dag
import
DAGExecutor
_LOGGER
=
logging
.
getLogger
()
_LOGGER
=
logging
.
getLogger
(
"pipeline.pipeline_server"
)
class
PipelineServicer
(
pipeline_service_pb2_grpc
.
PipelineServiceServicer
):
...
...
python/pipeline/profiler.py
浏览文件 @
bb6c627b
...
...
@@ -27,7 +27,7 @@ import time
import
threading
import
multiprocessing
_TRACER
=
logging
.
getLogger
(
"
trac
er"
)
_TRACER
=
logging
.
getLogger
(
"
pipeline.profil
er"
)
class
PerformanceTracer
(
object
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录