once do, do it well
Posted buguge - Keep it simple,stupid
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了once do, do it well相关的知识,希望对你有一定的参考价值。
昨天出现一个生产问题。我们的channel系统代码里,调用其中一个三方服务商的http接口时未设置超时时间。碰巧昨天出现一笔http请求持续数小时始终无响应,加之程序是单线程处理交易请求,就出现因为线程一直处于RUNNABLE状态而导致系统生产能力严重下降。
现在说这个结论很easy,而昨天排查这个问题却很是花费了许多周折。
那么,解决这个问题,自然是为这个服务商的http请求设置合理的超时时间。
组内的小伙很快fix了这段代码,为方法里的http请求设置了connectTimeout和socketTimeout。
发现问题,上来就解决,往往是低效的方式。
为什么这么说呢?
曾经我们系统化地调整过channel里的对外http连接的超时时间。而怎么单单遗漏了这个服务商呢?原来,查看代码才发现,是这个服务商并没有依赖我们的公共的http util类,而是单独写的http post方法,藏匿得比较深。
consequently,once do,do it well。通过review代码后,我改成了让这个服务商也调用公共的http util来实现http通信。
当看到一些不好的代码时,会发现我还算优秀;当看到优秀的代码时,也才意识到持续学习的重要!--buguge
本文来自博客园,转载请注明原文链接:https://www.cnblogs.com/buguge/p/17307910.html
Life -1a How well do you sleep? Teacher: GABRIELE
课上内容(Lesson)
a fact n. 事实;实际;真相
take a nap (30-60min.) 睡午觉;小睡一下 # deep sleep
a power nap(20 min.) 一个小盹
词汇(Key Word )
expert 专家
regular 规律
hardly 几乎不
recommended 推荐
exactly 正确地
sunset 日落,傍晚
during 在...期间
句型(Sentences)
In modern society 在现在社会
It depends 看情况而定
during the day 在白天期间
Why do we sleep?
From birth, we spend a third of our lives asleep,but scientists still don‘t know exactly why.
Why do humans have problems sleeping?
In modern society, many people don‘t get the recommended seven or eight hours a night. We work long hours and we rarely go to bed at sunset.
Why do we sleep differently?
It depends on the timeof yeuar and also our age.Teenagers always need more sleep than adults.Lots of elderly people don‘t sleep longer than four or five hours,but they often take naps during the day.
语法(Grammar)
Adverbs of frequency 频率副词
1. An advbers of frequency goes after the verb to be but before the man verb.
2. An expression of frequency usually goes at the beginning or at the end of a sentence.
always 总是
usually 通常
normally / generally 通常地
often / frequently adv. 常常,时常
sometimes 有时
occasionally adv. 偶尔;间或
seldom 很少
rarely 难得
never 从不
以上是关于once do, do it well的主要内容,如果未能解决你的问题,请参考以下文章
UNIX 设计哲学:Do one thing and do it well
[2016-3-1]OMG美语每日笔记-How do dress well?Do you have any fashion tips?
Doing well in your courses ---- a guide by Andrej Karpathy