SR22
Flight Crew Instrument; Flight Crew Private
Flight Crew Last 90 Days 54; Flight Crew Total 1086; Flight Crew Type 608
Communication Breakdown; Confusion; Situational Awareness; Time Pressure
ATC Issue All Types; Conflict NMAC; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Flight Crew Took Evasive Action
ATC Equipment / Nav Facility / Buildings; Human Factors; Procedure
I requested VFR flight following to ZZZ1 (a westerly departure) on the ground with ZZZ ground.  I was issued a squawk code and frequency.  I was subsequently cleared for takeoff by ZZZ Tower.  I was on initial climb out and began a turn to the west. I heard an aircraft report; 'we have a Cherokee right in front of us'!  At that moment my traffic information system called; 'traffic same altitude nine o'clock'.  I looked again to my left and saw a high wing aircraft within 100 feet of me at the same altitude!  He was so close I thought we were going to collide!  I had little time to react and the aircraft passed within a few feet behind me.  I pressed the PTT switch and said; 'that was close!'; to which the (presumably) pilot of the other aircraft responded; 'was that on purpose'?  I responded; 'of course not'!  I don't understand this comment.  It was as if Aircraft Y saw the impending convergence and decided to remain on course even though I was on his right side.  A few seconds later ZZZ Tower initiates my hand off to contact Approach.  I responded with; 'ZZZ Tower; go ahead with your telephone number' as I was incredibly shaken up from the extreme near miss and wanted to debrief post landing.Why did the controller not prevent this?  many minutes after my near miss the ZZZ Tower controller comes on frequency and advises all traffic the radar is out of service or intermittent.  I understand that equipment can fail however; he should have had a mental picture of proceedings and not cleared Aircraft Y for an extended right downwind to Runway XX when I was departing for a westerly destination.After landing I called the ZZZ Tower at XX35 and spoke to Name; the ZZZ Tower supervisor.  I discovered the following. I think the near miss aircraft was Aircraft Y.  A flight school aircraft based at ZZZ. There is an apparent familiarity between the controller and the (presumably) CFI onboard Aircraft Y.
Pilot reported taking evasive action to avoid a collision with another aircraft. It was later determined that the Tower radar was intermittent.