Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2019-08-19 18:58:40 +08:00
commit 33acfde453
7 changed files with 655 additions and 412 deletions

View File

@ -69,17 +69,17 @@ package org.opensource.demo.singleton;
public class OpensourceSingleton {
    private static OpensourceSingleton uniqueInstance;
private static OpensourceSingleton uniqueInstance;
    private OpensourceSingleton() {
    }
private OpensourceSingleton() {
}
    public static OpensourceSingleton getInstance() {
        if (uniqueInstance == null) {
            uniqueInstance = new OpensourceSingleton();
        }
        return uniqueInstance;
    }
public static OpensourceSingleton getInstance() {
if (uniqueInstance == null) {
uniqueInstance = new OpensourceSingleton();
}
return uniqueInstance;
}
}
```
@ -102,20 +102,20 @@ package org.opensource.demo.singleton;
public class ImprovedOpensourceSingleton {
    private volatile static ImprovedOpensourceSingleton uniqueInstance;
private volatile static ImprovedOpensourceSingleton uniqueInstance;
    private ImprovedOpensourceSingleton() {}
private ImprovedOpensourceSingleton() {}
    public static ImprovedOpensourceSingleton getInstance() {
        if (uniqueInstance == null) {
            synchronized (ImprovedOpensourceSingleton.class) {
                if (uniqueInstance == null) {
                    uniqueInstance = new ImprovedOpensourceSingleton();
                }
            }
        }
        return uniqueInstance;
    }
public static ImprovedOpensourceSingleton getInstance() {
if (uniqueInstance == null) {
synchronized (ImprovedOpensourceSingleton.class) {
if (uniqueInstance == null) {
uniqueInstance = new ImprovedOpensourceSingleton();
}
}
}
return uniqueInstance;
}
}
```
@ -141,20 +141,20 @@ package org.opensource.demo.factory;
public class OpensourceFactory {
    public OpensourceJVMServers getServerByVendor([String][18] name) {
        if(name.equals("Apache")) {
            return new Tomcat();
        }
        else if(name.equals("Eclipse")) {
            return new Jetty();
        }
        else if (name.equals("RedHat")) {
            return new WildFly();
        }
        else {
            return null;
        }
    }
public OpensourceJVMServers getServerByVendor(String name) {
if(name.equals("Apache")) {
return new Tomcat();
}
else if(name.equals("Eclipse")) {
return new Jetty();
}
else if (name.equals("RedHat")) {
return new WildFly();
}
else {
return null;
}
}
}
```
@ -164,9 +164,9 @@ public class OpensourceFactory {
package org.opensource.demo.factory;
public interface OpensourceJVMServers {
    public void startServer();
    public void stopServer();
    public [String][18] getName();
public void startServer();
public void stopServer();
public String getName();
}
```
@ -176,17 +176,17 @@ public interface OpensourceJVMServers {
package org.opensource.demo.factory;
public class WildFly implements OpensourceJVMServers {
    public void startServer() {
        [System][19].out.println("Starting WildFly Server...");
    }
public void startServer() {
System.out.println("Starting WildFly Server...");
}
    public void stopServer() {
        [System][19].out.println("Shutting Down WildFly Server...");
    }
public void stopServer() {
System.out.println("Shutting Down WildFly Server...");
}
    public [String][18] getName() {
        return "WildFly";
    }
public String getName() {
return "WildFly";
}
}
```
@ -209,9 +209,9 @@ package org.opensource.demo.observer;
public interface Topic {
    public void addObserver([Observer][22] observer);
    public void deleteObserver([Observer][22] observer);
    public void notifyObservers();
public void addObserver(Observer observer);
public void deleteObserver(Observer observer);
public void notifyObservers();
}
```
@ -226,39 +226,39 @@ import java.util.List;
import java.util.ArrayList;
public class Conference implements Topic {
    private List<Observer> listObservers;
    private int totalAttendees;
    private int totalSpeakers;
    private [String][18] nameEvent;
private List<Observer> listObservers;
private int totalAttendees;
private int totalSpeakers;
private String nameEvent;
    public Conference() {
        listObservers = new ArrayList&lt;Observer&gt;();
    }
public Conference() {
listObservers = new ArrayList<Observer>();
}
    public void addObserver([Observer][22] observer) {
        listObservers.add(observer);
    }
public void addObserver(Observer observer) {
listObservers.add(observer);
}
    public void deleteObserver([Observer][22] observer) {
        int i = listObservers.indexOf(observer);
        if (i &gt;= 0) {
            listObservers.remove(i);
        }
    }
public void deleteObserver(Observer observer) {
int i = listObservers.indexOf(observer);
if (i >= 0) {
listObservers.remove(i);
}
}
    public void notifyObservers() {
        for (int i=0, nObservers = listObservers.size(); i &lt; nObservers; ++ i) {
            [Observer][22] observer = listObservers.get(i);
            observer.update(totalAttendees,totalSpeakers,nameEvent);
        }
    }
public void notifyObservers() {
for (int i=0, nObservers = listObservers.size(); i < nObservers; ++ i) {
Observer observer = listObservers.get(i);
observer.update(totalAttendees,totalSpeakers,nameEvent);
}
}
    public void setConferenceDetails(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
        this.totalAttendees = totalAttendees;
        this.totalSpeakers = totalSpeakers;
        this.nameEvent = nameEvent;
        notifyObservers();
    }
public void setConferenceDetails(int totalAttendees, int totalSpeakers, String nameEvent) {
this.totalAttendees = totalAttendees;
this.totalSpeakers = totalSpeakers;
this.nameEvent = nameEvent;
notifyObservers();
}
}
```
@ -269,8 +269,8 @@ public class Conference implements Topic {
```
package org.opensource.demo.observer;
public interface [Observer][22] {
    public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent);
public interface Observer {
public void update(int totalAttendees, int totalSpeakers, String nameEvent);
}
```
@ -281,27 +281,27 @@ public interface [Observer][22] {
```
package org.opensource.demo.observer;
public class MonitorConferenceAttendees implements [Observer][22] {
    private int totalAttendees;
    private int totalSpeakers;
    private [String][18] nameEvent;
    private Topic topic;
public class MonitorConferenceAttendees implements Observer {
private int totalAttendees;
private int totalSpeakers;
private String nameEvent;
private Topic topic;
    public MonitorConferenceAttendees(Topic topic) {
        this.topic = topic;
        topic.addObserver(this);
    }
public MonitorConferenceAttendees(Topic topic) {
this.topic = topic;
topic.addObserver(this);
}
    public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
        this.totalAttendees = totalAttendees;
        this.totalSpeakers = totalSpeakers;
        this.nameEvent = nameEvent;
        printConferenceInfo();
    }
public void update(int totalAttendees, int totalSpeakers, String nameEvent) {
this.totalAttendees = totalAttendees;
this.totalSpeakers = totalSpeakers;
this.nameEvent = nameEvent;
printConferenceInfo();
}
    public void printConferenceInfo() {
        [System][19].out.println(this.nameEvent + " has " + totalSpeakers + " speakers and " + totalAttendees + " attendees");
    }
public void printConferenceInfo() {
System.out.println(this.nameEvent + " has " + totalSpeakers + " speakers and " + totalAttendees + " attendees");
}
}
```

View File

@ -0,0 +1,164 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11244-1.html)
[#]: subject: (How to measure the health of an open source community)
[#]: via: (https://opensource.com/article/19/8/measure-project)
[#]: author: (Jon Lawrence https://opensource.com/users/the3rdlaw)
如何衡量一个开源社区的健康度
======
> 这比较复杂。
![](https://img.linux.net.cn/data/attachment/album/201908/19/184719nz3xuazppzu3vwcg.jpg)
作为一个经常管理软件开发团队的人,多年来我一直关注度量指标。一次次,我发现自己领导团队使用一个又一个的项目平台(例如 Jira、GitLab 和 Rally生成了大量可测量的数据。从那时起我已经及时投入了大量时间从记录平台中提取了有用的指标并采用了一种我们可以理解的格式然后使用这些指标对开发的许多方面做出更好的选择。
今年早些时候,我有幸在 [Linux 基金会][2]遇到了一个名为<ruby>[开源软件社区健康分析][3]<rt>Community Health Analytics for Open Source Software</rt></ruby>CHAOSS的项目。该项目侧重于从各种来源收集和丰富指标以便开源社区的利益相关者可以衡量他们项目的健康状况。
### CHAOSS 介绍
随着我对该项目的基本指标和目标越来越熟悉,一个问题在我的脑海中不断翻滚。什么是“健康”的开源项目,由谁来定义?
特定角色的人认为健康的东西可能另一个角色的人就不会这样认为。似乎可以用 CHAOSS 收集的细粒度数据进行市场细分实验,重点关注对特定角色可能最有意义的背景问题,以及 CHAOSS 收集哪些指标可能有助于回答这些问题。
CHAOSS 项目创建并维护了一套开源应用程序和度量标准定义,使得这个实验具有可能性,这包括:
* 许多基于服务器的应用程序,用于收集、聚合和丰富度量标准(例如 Augur 和 GrimoireLab
* ElasticSearch、Kibana 和 LogstashELK的开源版本。
* 身份服务、数据分析服务和各种集成库。
在我过去的一个程序中,有六个团队从事于不同复杂程度的项目,我们找到了一个简洁的工具,它允许我们从简单(或复杂)的 JQL 语句中创建我们想要的任何类型的指标,然后针对这些指标开发计算。在我们注意到之前,我们仅从 Jira 中就提取了 400 多个指标,而且还有更多指标来自手动的来源。
在项目结束时,我们认定这 400 个指标中,大多数指标在*以我们的角色*做出决策时并不重要。最终,只有三个对我们非常重要:“缺陷去除效率”、“已完成的条目与承诺的条目”,以及“每个开发人员的工作进度”。这三个指标最重要,因为它们是我们对自己、客户和团队成员所做出的承诺,因此是最有意义的。
带着这些通过经验得到的教训和对什么是健康的开源项目的问题,我跳进了 CHAOSS 社区,开始建立一套角色,以提供一种建设性的方法,从基于角色的角度回答这个问题。
CHAOSS 是一个开源项目,我们尝试使用民主共识来运作。因此,我决定使用<ruby>组成分子<rt>constituent</rt></ruby>这个词而不是利益相关者,因为它更符合我们作为开源贡献者的责任,以创建更具共生性的价值链。
虽然创建此组成模型的过程采用了特定的“目标-问题-度量”方法但有许多方法可以进行细分。CHAOSS 贡献者已经开发了很好的模型,可以按照矢量进行细分,例如项目属性(例如,个人、公司或联盟)和“失败容忍度”。在为 CHAOSS 开发度量定义时,每个模型都会提供建设性的影响。
基于这一切,我开始构建一个谁可能关心 CHAOSS 指标的模型,以及每个组成分子在 CHAOSS 的四个重点领域中最关心的问题:
* [多样性和包容性][4]
* [演化][5]
* [风险][6]
* [价值][7]
在我们深入研究之前,重要的是要注意 CHAOSS 项目明确地将背景判断留给了实施指标的团队。什么是“有意义的”和“什么是健康的”的答案预计会因团队和项目而异。CHAOSS 软件的现成仪表板尽可能地关注客观指标。在本文中,我们关注项目创始人、项目维护者和贡献者。
### 项目组成分子
虽然这绝不是这些组成分子可能认为重要的问题的详尽清单,但这些选择感觉是一个好的起点。以下每个“目标-问题-度量”标准部分与 CHAOSS 项目正在收集和汇总的指标直接相关。
现在,进入分析的第 1 部分!
#### 项目创始人
作为**项目创始人**,我**最**关心:
* 我的项目**对其他人有用吗?**通过以下测量:
* 随着时间推移有多少复刻?
* **指标:**存储库复刻数。
* 随着时间的推移有多少贡献者?
* **指标:**贡献者数量。
* 贡献净质量。
* **指标:**随着时间的推移提交的错误。
* **指标:**随着时间的回归。
* 项目的财务状况。
* **指标:**随着时间的推移的捐赠/收入。
* **指标:**随着时间的推移的费用。
* 我的项目对其它人的**可见**程度?
* 有谁知道我的项目?别人认为它很整洁吗?
* **指标:**社交媒体上的提及、分享、喜欢和订阅的数量。
* 有影响力的人是否了解我的项目?
* **指标:**贡献者的社会影响力。
* 人们在公共场所对项目有何评价?是正面还是负面?
* **指标:**跨社交媒体渠道的情感(关键字或 NLP分析。
* 我的项目**可行性**程度?
* 我们有足够的维护者吗?该数字是随着时间的推移而上升还是下降?
* **指标:**维护者数量。
* 改变速度如何随时间变化?
* **指标:**代码随时间的变化百分比。
* **指标:**拉取请求、代码审查和合并之间的时间。
* 我的项目的[多样化 包容性][4]如何?
* 我们是否拥有有效的公开行为准则CoC
* **度量标准:** 检查存储库中的 CoC 文件。
* 与我的项目相关的活动是否积极包容?
* **指标:**关于活动的票务政策和活动包容性行为的手动报告。
* 我们的项目在可访问性上做的好不好?
* **指标:**验证发布的文字会议纪要。
* **指标:**验证会议期间使用的隐藏式字幕。
* **指标:**验证在演示文稿和项目前端设计中色盲可访问的素材。
* 我的项目代表了多少[价值][7]
* 我如何帮助组织了解使用我们的项目将节省多少时间和金钱(劳动力投资)
* **指标:**仓库的议题、提交、拉取请求的数量和估计人工费率。
* 我如何理解项目创建的下游价值的数量,以及维护我的项目对更广泛的社区的重要性(或不重要)?
* **指标:**依赖我的项目的其他项目数。
* 为我的项目做出贡献的人有多少机会使用他们学到的东西来找到合适的工作岗位,以及在哪些组织(即生活工资)?
* **指标:**使用或贡献此库的组织数量。
* **指标:**使用此类项目的开发人员的平均工资。
* **指标:**与该项目匹配的关键字的职位发布计数。
### 项目维护者
作为**项目维护者**,我**最**关心:
* 我是**高效的**维护者吗?
* **指标:**拉取请求在代码审查之前等待的时间。
* **指标:**代码审查和后续拉取请求之间的时间。
* **指标:**我的代码审核中有多少被批准?
* **指标:**我的代码评论中有多少被拒绝或返工?
* **指标:**代码审查的评论的情感分析。
* 我如何让**更多人**帮助我维护这件事?
* **指标:**项目贡献者的社交覆盖面数量。
* 我们的**代码质量**随着时间的推移变得越来越好吗?
* **指标:**计算随着时间的推移引入的回归数量。
* **指标:**计算随着时间推移引入的错误数量。
* **指标:**错误归档、拉取请求、代码审查、合并和发布之间的时间。
### 项目开发者和贡献者
作为**项目开发者或贡献者**,我**最**关心:
* 我可以从为这个项目做出贡献中获得哪些有价值的东西,以及实现这个价值需要多长时间?
* **指标:**下游价值。
* **指标:**提交、代码审查和合并之间的时间。
* 通过使用我在贡献中学到的东西来增加工作机是否有良好的前景?
* **指标:**生活工资。
* 这个项目有多受欢迎?
* **指标:**社交媒体帖子、分享和收藏的数量。
* 社区有影响力的人知道我的项目吗?
* **指标:**创始人、维护者和贡献者的社交范围。
通过创建这个列表,我们开始让 CHAOSS 更加丰满了,并且在今年夏天项目中首次发布该指标时,我迫不及待地想看看广泛的开源社区可能有什么其他伟大的想法,以及我们还可以从这些贡献中学到什么(并衡量!)。
### 其它角色
接下来,你需要了解有关其他角色(例如基金会、企业开源计划办公室、业务风险和法律团队、人力资源等)以及最终用户的目标问题度量集的更多信息。他们关心开源的不同事物。
如果你是开源贡献者或组成分子,我们邀请你[来看看这个项目][8]并参与社区活动!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/measure-project
作者:[Jon Lawrence][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/the3rdlaw
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
[2]: https://www.linuxfoundation.org/
[3]: https://chaoss.community/
[4]: https://github.com/chaoss/wg-diversity-inclusion
[5]: https://github.com/chaoss/wg-evolution
[6]: https://github.com/chaoss/wg-risk
[7]: https://github.com/chaoss/wg-value
[8]: https://github.com/chaoss/

View File

@ -1,111 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip])
[#]: via: (https://itsfoss.com/turn-on-raspberry-pi/)
[#]: author: (Chinmay https://itsfoss.com/author/chinmay/)
How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip]
======
_**Brief: This quick tip teaches you how to turn on Raspberry Pi and how to shut it down properly afterwards.**_
The [Raspberry Pi][1] is one of the [most popular SBC (Single-Board-Computer)][2]. If you are interested in this topic, I believe that youve finally got a Pi device. I also advise to get all the [additional Raspberry Pi accessories][3] to get started with your device.
Youre ready to turn it on and start to tinker around with it. It has its own similarities and differences compared to traditional computers like desktops and laptops.
Today, lets go ahead and learn how to turn on and shutdown a Raspberry Pi as it doesnt really feature a power button of sorts.
For this article Im using a Raspberry Pi 3B+, but its the same for all the Raspberry Pi variants.
Bestseller No. 1
[][4]
[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4]
CanaKit - Personal Computers
$79.99 [][5]
Bestseller No. 2
[][6]
[CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply][6]
CanaKit - Personal Computers
$54.99 [][5]
### Turn on Raspberry Pi
![Micro USB port for Power][7]
The micro USB port powers the Raspberry Pi, the way you turn it on is by plugging in the power cable into the micro USB port. But, before you do that you should make sure that you have done the following things.
* Preparing the micro SD card with Raspbian according to the official [guide][8] and inserting into the micro SD card slot.
* Plugging in the HDMI cable, USB keyboard and a Mouse.
* Plugging in the Ethernet Cable(Optional).
Once you have done the above, plug in the power cable. This turns on the Raspberry Pi and the display will light up and load the Operating System.
Bestseller No. 1
[][4]
[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4]
CanaKit - Personal Computers
$79.99 [][5]
### Shutting Down the Pi
Shutting down the Pi is pretty straight forward, click the menu button and choose shutdown.
![Turn off Raspberry Pi graphically][9]
Alternatively, you can use the [shutdown command][10] in the terminal:
```
sudo shutdown now
```
Once the shutdown process has started **wait** till it completely finishes and then you can cut the power to it. Once the Pi shuts down, there is no real way to turn the Pi back on without turning off and turning on the power. You could the GPIOs to turn on the Pi from the shutdown state but itll require additional modding.
[][2]
Suggested read 12 Single Board Computers: Alternative to Raspberry Pi
_Note: Micro USB ports tend to be fragile, hence turn-off/on the power at source instead of frequently unplugging and plugging into the micro USB port._
Well, thats about all you should know about turning on and shutting down the Pi, what do you plan to use it for? Let me know in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/turn-on-raspberry-pi/
作者:[Chinmay][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/chinmay/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.org/
[2]: https://itsfoss.com/raspberry-pi-alternatives/
[3]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/
[4]: https://www.amazon.com/CanaKit-Raspberry-Starter-Premium-Black/dp/B07BCC8PK7?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BCC8PK7&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case))
[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime)
[6]: https://www.amazon.com/CanaKit-Raspberry-Premium-Clear-Supply/dp/B07BC7BMHY?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BC7BMHY&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply)
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-3-microusb.png?fit=800%2C532&ssl=1
[8]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/Raspbian-ui-menu.jpg?fit=800%2C492&ssl=1
[10]: https://linuxhandbook.com/linux-shutdown-command/

View File

@ -1,202 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to measure the health of an open source community)
[#]: via: (https://opensource.com/article/19/8/measure-project)
[#]: author: (Jon Lawrence https://opensource.com/users/the3rdlaw)
How to measure the health of an open source community
======
It's complicated.
![metrics and data shown on a computer screen][1]
As a person who normally manages software development teams, over the years Ive come to care about metrics quite a bit. Time after time, Ive found myself leading teams using one project platform or another (Jira, GitLab, and Rally, for example) generating an awful lot of measurable data. From there, Ive promptly invested significant amounts of time to pull useful metrics out of the platform-of-record and into a format where we could make sense of them, and then use the metrics to make better choices about many aspects of development.
Earlier this year, I had the good fortune of coming across a project at the [Linux Foundation][2] called [Community Health Analytics for Open Source Software][3], or CHAOSS. This project focuses on collecting and enriching metrics from a wide range of sources so that stakeholders in open source communities can measure the health of their projects.
### What is CHAOSS?
As I grew familiar with the projects underlying metrics and objectives, one question kept turning over in my head. What is a "healthy" open source project, and by whose definition?
Whats considered healthy by someone in a particular role may not be viewed that way by someone in another role. It seemed there was an opportunity to back out from the granular data that CHAOSS collects and do a market segmentation exercise, focusing on what might be the most meaningful contextual questions for a given role, and what metrics CHAOSS collects that might help answer those questions.
This exercise was made possible by the fact that the CHAOSS project creates and maintains a suite of open source applications and metric definitions, including:
* A number of server-based applications for gathering, aggregating, and enriching metrics (such as Augur and GrimoireLab).
* The open source versions of ElasticSearch, Kibana, and Logstash (ELK).
* Identity services, data analysis services, and a wide range of integration libraries.
In one of my past programs, where half a dozen teams were working on projects of varying complexity, we found a neat tool which allowed us to create any kind of metric we wanted from a simple (or complex) JQL statement, and then develop calculations against and between those metrics. Before we knew it, we were pulling over 400 metrics from Jira alone, and more from manual sources.
By the end of the project, we decided that out of the 400-ish metrics, most of them didnt really matter when it came to making decisions _in our roles_. At the end of the day, there were only three that really mattered to us: "Defect Removal Efficiency," "Points completed vs. Points committed," and "Work-in-Progress per Developer." Those three metrics mattered most because they were promises we made to ourselves, to our clients, and to our team members, and were, therefore, the most meaningful.
Drawing from the lessons learned through that experience and the question of what is a healthy open source project?, I jumped into the CHAOSS community and started building a set of personas to offer a constructive approach to answering that question from a role-based lens.
CHAOSS is an open source project and we try to operate using democratic consensus. So, I decided that instead of stakeholders, Id use the word _constituent_, because it aligns better with the responsibility we have as open source contributors to create a more symbiotic value chain.
While the exercise of creating this constituent model takes a particular goal-question-metric approach, there are many ways to segment. CHAOSS contributors have developed great models that segment by vectors, like project profiles (for example, individual, corporate, or coalition) and "Tolerance to Failure." Every model provides constructive influence when developing metric definitions for CHAOSS.
Based on all of this, I set out to build a model of who might care about CHAOSS metrics, and what questions each constituent might care about most in each of CHAOSS four focus areas:
* [Diversity and Inclusion][4]
* [Evolution][5]
* [Risk][6]
* [Value][7]
Before we dive in, its important to note that the CHAOSS project expressly leaves contextual judgments to teams implementing the metrics. Whats "meaningful" and the answer to "What is healthy?" is expected to vary by team and by project. The CHAOSS softwares ready-made dashboards focus on objective metrics as much as possible. In this article, we focus on project founders, project maintainers, and contributors.
### Project constituents
While this is by no means an exhaustive list of questions these constituents might feel are important, these choices felt like a good place to start. Each of the Goal-Question-Metric segments below is directly tied to metrics that the CHAOSS project is collecting and aggregating.
Now, on to Part 1 of the analysis!
#### Project founders
As a **project founder**, I care **most** about:
* Is my project **useful to others?** Measured as a function of:
* How many forks over time?
**Metric:** Repository forks.
* How many contributors over time?
**Metric:** Contributor count.
* Net quality of contributions.
**Metric:** Bugs filed over time.
**Metric:** Regressions over time.
* Financial health of my project.
**Metric:** Donations/Revenue over time.
**Metric:** Expenses over time.
* How **visible** is my project to others?
* Does anyone know about my project? Do others think its neat?
**Metric:** Social media mentions, shares, likes, and subscriptions.
* Does anyone with influence know about my project?
**Metric:** Social reach of contributors.
* What are people saying about the project in public spaces? Is it positive or negative?
**Metric:** Sentiment (keyword or NLP) analysis across social media channels.
* How **viable** is my project?
* Do we have enough maintainers? Is the number rising or falling over time?
**Metric:** Number of maintainers.
* Do we have enough contributors? Is the number rising or falling over time?
**Metric:** Number of contributors.
* How is velocity changing over time?
**Metric:** Percent change of code over time.
**Metric:** Time between pull request, code review, and merge.
* How [**diverse &amp; inclusive**][4] is my project?
* Do we have a valid, public, Code of Conduct (CoC)?
**Metric:** CoC repository file check.
* Are events associated with my project actively inclusive?
**Metric:** Manual reporting on event ticketing policies and event inclusion activities.
* Does our project do a good job of being accessible?
**Metric:** Validation of typed meeting minutes being posted.
**Metric:** Validation of closed captioning used during meetings.
**Metric:** Validation of color-blind-accessible materials in presentations and in project front-end designs.
* How much [**value**][7] does my project represent?
* How can I help organizations understand how much time and money using our project would save them (labor investment)
**Metric:** Repo count of issues, commits, pull requests, and the estimated labor rate.
* How can I understand the amount of downstream value my project creates and how vital (or not) it is to the wider community to maintain my project?
**Metric:** Repo count of how many other projects rely on my project.
* How much opportunity is there for those contributing to my project to use what they learn working on it to land good jobs and at what organizations (aka living wage)?
**Metric:** Count of organizations using or contributing to this library.
**Metric:** Averages of salaries for developers working with this kind of project.
**Metric:** Count of job postings with keywords that match this project.
### Project maintainers
As a **Project Maintainer,** I care **most** about:
* Am I an **efficient** maintainer?
**Metric:** Time PRs wait before a code review.
**Metric:** Time between code review and subsequent PRs.
**Metric:** How many of my code reviews are approvals?
**Metric:** How many of my code reviews are rejections/rework requests?
**Metric:** Sentiment analysis of code review comments.
* How do I get **more people** to help me maintain this thing?
**Metric:** Count of social reach of project contributors.
* Is our **code quality** getting better or worse over time?
**Metric:** Count how many regressions are being introduced over time.
**Metric:** Count how many bugs are being introduced over time.
**Metric:** Time between bug filing, pull request, review, merge, and release.
### Project developers and contributors
As a **project developer or contributor**, I care most about:
* What things of value can I gain from contributing to this project and how long might it take to realize that value?
**Metric:** Downstream value.
**Metric:** Time between commits, code reviews, and merges.
* Are there good prospects for using what I learn by contributing to increase my job opportunities?
**Metric:** Living wage.
* How popular is this project?
**Metric:** Counts of social media posts, shares, and favorites.
* Do community influencers know about my project?
**Metric:** Social reach of founders, maintainers, and contributors.
By creating this list, weve just begun to put meat on the contextual bones of CHAOSS, and with the first release of metrics in the project this summer, I cant wait to see what other great ideas the broader open source community may have to contribute and what else we can all learn (and measure!) from those contributions.
### Other roles
Next, you need to learn more about goal-question-metric sets for other roles (such as foundations, corporate open source program offices, business risk and legal teams, human resources, and others) as well as end users, who have a distinctly different set of things they care about when it comes to open source.
If youre an open source contributor or constituent, we invite you to [come check out the project][8] and get engaged in the community!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/measure-project
作者:[Jon Lawrence][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/the3rdlaw
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
[2]: https://www.linuxfoundation.org/
[3]: https://chaoss.community/
[4]: https://github.com/chaoss/wg-diversity-inclusion
[5]: https://github.com/chaoss/wg-evolution
[6]: https://github.com/chaoss/wg-risk
[7]: https://github.com/chaoss/wg-value
[8]: https://github.com/chaoss/

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,321 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Create Availability Zones in OpenStack from Command Line)
[#]: via: (https://www.linuxtechi.com/create-availability-zones-openstack-command-line/)
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
How to Create Availability Zones in OpenStack from Command Line
======
In **OpenStack** terminology, **Availability Zones (AZ**) is defined as a logical partition of compute(nova), block storage (cinder) and network Service (neutron). Availability zones are required to segregate the work load of environments like production and non-production, let me elaborate this statement.
[![Availability-Zones-OpenStack-Command-Line][1]][2]
lets suppose we have a tenant in OpenStack who wants to deploy their VMs in Production and Non-Production, so to create this type of setup in openstack , first we have to identify which computes will be considered as Production and Non-production then we have to create host-aggregate group where we will add the computes to the host-aggregate group and then we will map th host aggregate group to the Availability Zone.
In this tutorial we will demonstrate how to create and use computes availability zones in openstack via command line.
### Creating compute availability zones
Whenever OpenStack is deployed, Nova is the default Availability Zone(AZ) created automatically and all the compute nodes belongs to Nova AZ. Run the below openstack command from the controller node to list Availability zones,
```
~# source openrc
~# openstack availability zone list
+-----------+-------------+
| Zone Name | Zone Status |
+-----------+-------------+
| internal | available |
| nova | available |
| nova | available |
| nova | available |
+-----------+-------------+
~#
```
To list only computes availability zones, run the beneath openstack command,
```
~# openstack availability zone list --compute
+-----------+-------------+
| Zone Name | Zone Status |
+-----------+-------------+
| internal | available |
| nova | available |
+-----------+-------------+
~#
```
To list all compute hosts which are mapped to nova availability zone execute the below command,
```
~# openstack host list | grep -E "Zone|nova"
| Host Name | Service | Zone |
| compute-0-1 | compute | nova |
| compute-0-2 | compute | nova |
| compute-0-4 | compute | nova |
| compute-0-3 | compute | nova |
| compute-0-8 | compute | nova |
| compute-0-6 | compute | nova |
| compute-0-9 | compute | nova |
| compute-0-5 | compute | nova |
| compute-0-7 | compute | nova |
~#
```
Lets create a two host-aggregate group with name **production** and **non-production**, add compute-4,5 &amp; 6 to production host aggregate group and compute-7,8 &amp; 9 to non-production host aggregate group.
Create Production and Non-Production Host aggregate using following OpenStack commands,
```
~# openstack aggregate create production
+-------------------+----------------------------+
| Field | Value |
+-------------------+----------------------------+
| availability_zone | None |
| created_at | 2019-08-17T03:02:41.561259 |
| deleted | False |
| deleted_at | None |
| id | 7 |
| name | production |
| updated_at | None |
+-------------------+----------------------------+
~# openstack aggregate create non-production
+-------------------+----------------------------+
| Field | Value |
+-------------------+----------------------------+
| availability_zone | None |
| created_at | 2019-08-17T03:02:53.806713 |
| deleted | False |
| deleted_at | None |
| id | 10 |
| name | non-production |
| updated_at | None |
+-------------------+----------------------------+
~#
```
Now create the availability zones and associate it to its respective host aggregate groups
**Syntax:**
# openstack aggregate set zone &lt;az_name&gt;  &lt;host_aggregate_name&gt;
```
~# openstack aggregate set --zone production-az production
~# openstack aggregate set --zone non-production-az non-production
```
Finally add the compute host to its host-aggregate group
**Syntax:**
# openstack aggregate add host &lt;host_aggregate_name&gt;  &lt;compute_host&gt;
```
~# openstack aggregate add host production compute-0-4
~# openstack aggregate add host production compute-0-5
~# openstack aggregate add host production compute-0-6
```
Similarly add compute host to non-production host aggregation group,
```
~# openstack aggregate add host non-production compute-0-7
~# openstack aggregate add host non-production compute-0-8
~# openstack aggregate add host non-production compute-0-9
```
Execute the beneath openstack commands to verify Host aggregate group and its availability zone
```
~# openstack aggregate list
+----+----------------+-------------------+
| ID | Name | Availability Zone |
+----+----------------+-------------------+
| 7 | production | production-az |
| 10 | non-production | non-production-az |
+----+----------------+-------------------+
~#
```
Run below commands to list computes associated to AZ and host aggregate group
```
~# openstack aggregate show production
+-------------------+--------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------+
| availability_zone | production-az |
| created_at | 2019-08-17T03:02:42.000000 |
| deleted | False |
| deleted_at | None |
| hosts | [u'compute-0-4', u'compute-0-5', u'compute-0-6'] |
| id | 7 |
| name | production |
| properties | |
| updated_at | None |
+-------------------+--------------------------------------------+
~# openstack aggregate show non-production
+-------------------+---------------------------------------------+
| Field | Value |
+-------------------+---------------------------------------------+
| availability_zone | non-production-az |
| created_at | 2019-08-17T03:02:54.000000 |
| deleted | False |
| deleted_at | None |
| hosts | [u'compute-0-7', u'compute-0-8', u'compute-0-9'] |
| id | 10 |
| name | non-production |
| properties | |
| updated_at | None |
+-------------------+---------------------------------------------+
~#
```
Above commands output confirm that we have successfully create host aggregate group and availability zones.
### Launch Virtual Machines in Availability Zones
Now lets create couple virtual machines in these two availability zones, to create a vm in particular availability zone use below command,
**Syntax:**
# openstack server create flavor &lt;flavor-name&gt; image &lt;Image-Name-Or-Image-ID&gt;  nic net-id=&lt;Network-ID&gt; security-group &lt;Security-Group-ID&gt; key-name &lt;Keypair-Name&gt; availability-zone &lt;AZ-Name&gt;   &lt;VM-Name&gt;
Example is shown below:
```
~# openstack server create --flavor m1.small --image Cirros --nic net-id=37b9ab9a-f198-4db1-a5d6-5789b05bfb4c --security-group f8dda7c3-f7c3-423b-923a-2b21fe0bbf3c --key-name mykey --availability-zone production-az test-vm-prod-az
```
Run below command to verify virtual machine details:
```
~# openstack server show test-vm-prod-az
```
![Openstack-Server-AZ-command][1]
To create a virtual machine in a specific compute node under availability zone, use the below command,
**Syntax:**
# openstack server create flavor &lt;flavor-name&gt; image &lt;Image-Name-Or-Image-ID&gt;  nic net-id=&lt;Network-ID&gt; security-group &lt;Security-Group-ID&gt; key-name {Keypair-Name} availability-zone &lt;AZ-Name&gt;:&lt;Compute-Host&gt; &lt;VM-Name&gt;
Let suppose we want to spin a vm under production AZ on specific compute (compute-0-6), so to accomplish this, run the beneath command,
```
~# openstack server create --flavor m1.small --image Cirros --nic net-id=37b9ab9a-f198-4db1-a5d6-5789b05bfb4c --security-group f8dda7c3-f7c3-423b-923a-2b21fe0bbf3c --key-name mykey --availability-zone production-az:compute-0-6 test-vm-prod-az-host
```
Execute following command to verify the VM details:
```
~# openstack server show test-vm-prod-az-host
```
Output above command would be something like below:
![OpenStack-VM-AZ-Specific-Host][1]
Similarly, we can create virtual machines in non-production AZ, example is shown below
```
~# openstack server create --flavor m1.small --image Cirros --nic net-id=37b9ab9a-f198-4db1-a5d6-5789b05bfb4c --security-group f8dda7c3-f7c3-423b-923a-2b21fe0bbf3c --key-name mykey --availability-zone non-production-az vm-nonprod-az
```
Use below command verify the VM details,
```
~# openstack server show vm-nonprod-az
```
Output of above command would be something like below,
![OpenStack-Non-Production-AZ-VM][1]
### Removing Host aggregate group and Availability Zones
Lets suppose we want to remove /delete above created host aggregate group and availability zones, for that first we must remove host from the host aggregate group, use the below command,
```
~# openstack aggregate show production
```
Above command will give u the list of compute host which are added to production host aggregate group.
Use below command to remove host from the host aggregate group
**Syntax:**
# openstack aggregate remove host &lt;host-aggregate-name&gt; &lt;compute-name&gt;
```
~# openstack aggregate remove host production compute-0-4
~# openstack aggregate remove host production compute-0-5
~# openstack aggregate remove host production compute-0-6
```
Once you remove all host from the group, then re-run the below command,
```
~# openstack aggregate show production
+-------------------+----------------------------+
| Field | Value |
+-------------------+----------------------------+
| availability_zone | production-az |
| created_at | 2019-08-17T03:02:42.000000 |
| deleted | False |
| deleted_at | None |
| hosts | [] |
| id | 7 |
| name | production |
| properties | |
| updated_at | None |
+-------------------+----------------------------+
~#
```
As we can see in above output there is no compute host associated to production host aggregate group, now we are good to remove the group
Use below command to delete host aggregate group and its associated availability zone
```
~# openstack aggregate delete production
```
Run the following command to check whether availability zone has been removed or not,
```
~# openstack availability zone list | grep -i production-az
~#
```
Similarly, you can refer the above steps to remove or delete non-production host aggregate and its availability zone.
Thats all from this tutorial, in case above content helps you to understand OpenStack host aggregate and availability zones then please do share your feedback and comments.
**Read Also: [Top 30 OpenStack Interview Questions and Answers][3]**
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/create-availability-zones-openstack-command-line/
作者:[Pradeep Kumar][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lujun9972
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/08/Availability-Zones-OpenStack-Command-Line.jpg
[3]: https://www.linuxtechi.com/openstack-interview-questions-answers/

View File

@ -0,0 +1,71 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip])
[#]: via: (https://itsfoss.com/turn-on-raspberry-pi/)
[#]: author: (Chinmay https://itsfoss.com/author/chinmay/)
如何打开和关闭树莓派(新手教程)
======
_ **简介:这个贴士教你如何打开树莓派以及如何在之后正确关闭它。** _
[树莓派][1]是[最流行的 SBC单板计算机][2]之一。如果你对这个话题感兴趣,我相信你已经有了一个树莓派。我还建议你使用[其他树莓派配件][3]来开始使用你的设备。
你已经准备好打开并开始使用。与桌面和笔记本电脑等传统电脑相比,它有相似以及不同之处。
今天,让我们继续学习如何打开和关闭树莓派,因为它并没有真正的“电源按钮”。
在本文中,我使用的是树莓派 3B+,但对于所有树莓派变体都是如此。
### 如何打开树莓派
![Micro USB port for Power][7]
micro USB 口为树莓派供电,打开它的方式是将电源线插入 micro USB 口。但是开始之前,你应该确保做了以下事情。
* 根据官方[指南][8]准备带有 Raspbian 的 micro SD 卡并插入 micro SD 卡插槽。
  * 插入 HDMI 线、USB 键盘和鼠标。
  * 插入以太网线(可选)。
成上述操作后,请插入电源线。这会打开树莓派,显示屏将亮起并加载操作系统。
### 关闭树莓派
关闭树莓派非常简单,单击菜单按钮并选择关闭。
![Turn off Raspberry Pi graphically][9]
或者你可以在终端使用 [shutdown 命令][10]
```
sudo shutdown now
```
shutdown 执行后**等待**它完成,接着你可以关闭电源。树莓派关闭后,没有真正的办法可以在不重新打开电源的情况下打开树莓派。你可以使用 GPIO 打开树莓派,但这需要额外的改装。
_注意Micro USB 口往往是脆弱的,因此请关闭/打开电源,而不是经常拔出插入 micro USB 口。_
好吧,这就是关于打开和关闭树莓派的所有内容,你打算用它做什么?请在评论中告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/turn-on-raspberry-pi/
作者:[Chinmay][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/chinmay/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.org/
[3]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-3-microusb.png?fit=800%2C532&ssl=1
[8]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/Raspbian-ui-menu.jpg?fit=800%2C492&ssl=1
[10]: https://linuxhandbook.com/linux-shutdown-command/